From 0d4b490f79de86caca250ba2fee936e37cf6ec31 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 24 Feb 2009 15:46:27 +0100 Subject: [PATCH] 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 --- libs/blkid/src/probers/ext.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; -- 2.39.5