diff options
author | md@Linux.IT <md@Linux.IT> | 2003-11-24 03:35:03 +0100 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-27 06:13:02 +0200 |
commit | 04a81cac0aab2ab6a54ddc661dd57be7d5b1595a (patch) | |
tree | 5ba3e3d0be2364201023f98cf8d3189c213db6af | |
parent | [PATCH] remove Makefile.klibc (diff) | |
download | systemd-04a81cac0aab2ab6a54ddc661dd57be7d5b1595a.tar.xz systemd-04a81cac0aab2ab6a54ddc661dd57be7d5b1595a.zip |
[PATCH] fix segfault in parsing bad udev.permissions file
-rw-r--r-- | namedev.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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); |