From: Jim Meyering Date: Tue, 24 Feb 2009 14:46:27 +0000 (+0100) Subject: blkid: don't dereference NULL upon slashless module dependency line X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d4b490f79de86caca250ba2fee936e37cf6ec31;p=util-linux blkid: don't dereference NULL upon slashless module dependency line * 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 Signed-off-by: Karel Zak --- diff --git a/libs/blkid/src/probers/ext.c b/libs/blkid/src/probers/ext.c index 01ae7cc6..ff0e51b1 100644 --- a/libs/blkid/src/probers/ext.c +++ b/libs/blkid/src/probers/ext.c @@ -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;