mirror of
https://github.com/systemd/systemd.git
synced 2024-12-01 06:13:38 +08:00
core: check for overflow when handling scaled MemoryLimit= settings
Just in case...
This commit is contained in:
parent
79baeeb96d
commit
b3785cd5e6
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user