core: avoid using uninitialized buffer on bad systemd.random_seed=
unbase64mem() leaves p/sz uninitialized on failure, and the
deserialization doesn't bail out in that case, unlike other cases.
Follow-up for d247f232a8
This commit is contained in:
+3
-1
@@ -543,8 +543,10 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
|
||||
return 0;
|
||||
|
||||
r = unbase64mem(value, &p, &sz);
|
||||
if (r < 0)
|
||||
if (r < 0) {
|
||||
log_warning_errno(r, "Failed to parse systemd.random_seed= argument, ignoring: %s", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
free(arg_random_seed);
|
||||
arg_random_seed = sz > 0 ? p : mfree(p);
|
||||
|
||||
Reference in New Issue
Block a user