diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-07-22 15:30:23 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-07-22 15:33:13 +0200 |
commit | b3785cd5e6a0ac4d465713db221e1a150aabd5f6 (patch) | |
tree | 846205997c2e8a200d92d48c75852b3be3c8e633 | |
parent | 79baeeb96d58676853521e10a358e85d83dac7f1 (diff) |
core: check for overflow when handling scaled MemoryLimit= settings
Just in case...
-rw-r--r-- | src/core/load-fragment.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index cd7bf9c707..ae306de4ae 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -2823,8 +2823,8 @@ int config_parse_memory_limit( } else bytes = physical_memory_scale(r, 100U); - if (bytes < 1) { - log_syntax(unit, LOG_ERR, filename, line, 0, "Memory limit '%s' too small. Ignoring.", rvalue); + if (bytes <= 0 || bytes >= UINT64_MAX) { + log_syntax(unit, LOG_ERR, filename, line, 0, "Memory limit '%s' out of range. Ignoring.", rvalue); return 0; } } |