summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--namedev.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/namedev.c b/namedev.c
index bed328f646..24b9bc01ac 100644
--- a/namedev.c
+++ b/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);