mdoprobe: fix SEGV bug (by Vlad Dronnikov)
authorDenis Vlasenko <vda.linux@googlemail.com>
Sun, 22 Jun 2008 16:59:46 +0000 (16:59 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Sun, 22 Jun 2008 16:59:46 +0000 (16:59 -0000)
modutils/modprobe.c

index 84a2d76867d78665ef134ce32f3eeb00a7a0ad2f..3ac5a81a552fbc4d106331d18643a97a54b533b8 100644 (file)
@@ -443,10 +443,8 @@ static struct dep_t *build_dep(void)
                        /* It's a dep description continuation */
                        p = line_buffer;
 
-               p = skip_whitespace(p);
-
                /* p points to the first dependable module; if NULL, no dependable module */
-               if (p && *p) {
+               if (p && (p = skip_whitespace(p))[0] != '\0') {
                        char *end = &line_buffer[l-1];
                        const char *deps;
                        char *dep;