mirror of
https://github.com/systemd/systemd.git
synced 2025-01-11 09:18:07 +03:00
[PATCH] fix segfault in parsing bad udev.permissions file
This commit is contained in:
parent
388e2a6a47
commit
04a81cac0a
12
namedev.c
12
namedev.c
@ -439,12 +439,24 @@ static int namedev_init_permissions(void)
|
||||
|
||||
/* parse the line */
|
||||
temp2 = strsep(&temp, ":");
|
||||
if (!temp2) {
|
||||
dbg("cannot parse line: %s", line);
|
||||
continue;
|
||||
}
|
||||
strncpy(dev.name, temp2, sizeof(dev.name));
|
||||
|
||||
temp2 = strsep(&temp, ":");
|
||||
if (!temp2) {
|
||||
dbg("cannot parse line: %s", line);
|
||||
continue;
|
||||
}
|
||||
strncpy(dev.owner, temp2, sizeof(dev.owner));
|
||||
|
||||
temp2 = strsep(&temp, ":");
|
||||
if (!temp2) {
|
||||
dbg("cannot parse line: %s", line);
|
||||
continue;
|
||||
}
|
||||
strncpy(dev.group, temp2, sizeof(dev.owner));
|
||||
|
||||
dev.mode = strtol(temp, NULL, 8);
|
||||
|
Loading…
Reference in New Issue
Block a user