]> err.no Git - util-linux/commitdiff
blkid: don't dereference NULL upon slashless module dependency line
authorJim Meyering <meyering@redhat.com>
Tue, 24 Feb 2009 14:46:27 +0000 (15:46 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 24 Feb 2009 15:00:32 +0000 (16:00 +0100)
* probers/ext.c (check_for_modules): Skip current line if it has no slash.

[kzak@redhat.com: - port the original e2fsprogs patch to util-linux-ng]

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
libs/blkid/src/probers/ext.c

index 01ae7cc60a329558aaecc309dd89904fdfbee6ae..ff0e51b136bed0f081e7dc340352f7f2c51556f2 100644 (file)
@@ -359,8 +359,9 @@ static int check_for_modules(const char *fs_name)
                        *cp = 0;
                else
                        continue;
-               if ((cp = strrchr(buf, '/')) != NULL)
-                       cp++;
+               if ((cp = strrchr(buf, '/')) == NULL)
+                       continue;
+               cp++;
                i = strlen(cp);
                if (i > 3) {
                        t = cp + i - 3;