From: Lennart Poettering Date: Fri, 22 Jul 2016 13:30:23 +0000 (+0200) Subject: core: check for overflow when handling scaled MemoryLimit= settings X-Git-Tag: v231~22^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b3785cd5e6a0ac4d465713db221e1a150aabd5f6;p=platform%2Fupstream%2Fsystemd.git core: check for overflow when handling scaled MemoryLimit= settings Just in case... --- diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index cd7bf9c..ae306de 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; } }