[PATCH] Don't dereference NULL upon slashless module dependency line.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* probe.c (check_for_modules): Skip current line if it has no slash.

Signed-off-by: Jim Meyering <meyering@xxxxxxxxxx>
---
I found this by inspection while looking for the cause of
a recent rawhide/nash segfault.

 lib/blkid/probe.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/blkid/probe.c b/lib/blkid/probe.c
index 76763ae..f5fff6b 100644
--- a/lib/blkid/probe.c
+++ b/lib/blkid/probe.c
@@ -225,8 +225,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;
--
1.6.2.rc1.256.g58a87
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux