summaryrefslogtreecommitdiff
path: root/namedev.c
diff options
context:
space:
mode:
authorazarah@nosferatu.za.org <azarah@nosferatu.za.org>2003-11-24 23:25:06 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:13:04 -0700
commitbefd83cc4ee33f6a557b531d4a1be13472ec67cd (patch)
tree981dcb53e25f301129ce5fdb6111b4e2d266d48d /namedev.c
parent49d72e43487164194263d2c80dd27a4627f2169c (diff)
[PATCH] more config file parsing robustness
udev kept on segfaulting when it was in use, and not having the time (and building it with DEBUG=true showing nothing), I have not tracked it until tonight. Seems like I made a type-o, and forgotten the ':' between one line's group and permission parameters. Attached patch should stop the segfault, and warn at that at least.
Diffstat (limited to 'namedev.c')
-rw-r--r--namedev.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/namedev.c b/namedev.c
index 83852f9df2..391da7efca 100644
--- a/namedev.c
+++ b/namedev.c
@@ -464,6 +464,10 @@ static int namedev_init_permissions(void)
}
strncpy(dev.group, temp2, sizeof(dev.owner));
+ if (!temp) {
+ dbg("cannot parse line: %s", line);
+ continue;
+ }
dev.mode = strtol(temp, NULL, 8);
dbg_parse("name='%s', owner='%s', group='%s', mode=%#o",