mirror of
https://github.com/morgan9e/systemd
synced 2026-04-16 01:16:10 +09:00
udev: fix invalid free() in enable_name_policy()
static bool enable_name_policy(...) in ./src/udev/net/link-config.c calls proc_cmdline(...) to get "line" initialized, but proc_cmdline(...) does not guarantee that atleast when both conditions (detect_container(NULL) > 0) and read_full_file(...) returned < 0.
This commit is contained in:
committed by
Tom Gundersen
parent
3e09eb5c83
commit
f8a0bb5285
@@ -185,7 +185,7 @@ static int load_link(link_config_ctx *ctx, const char *filename) {
|
||||
}
|
||||
|
||||
static bool enable_name_policy(void) {
|
||||
_cleanup_free_ char *line;
|
||||
_cleanup_free_ char *line = NULL;
|
||||
char *w, *state;
|
||||
int r;
|
||||
size_t l;
|
||||
|
||||
Reference in New Issue
Block a user