summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-02-24 15:46:27 +0100
committerKarel Zak <kzak@redhat.com>2009-02-24 16:00:32 +0100
commit0d4b490f79de86caca250ba2fee936e37cf6ec31 (patch)
treeb5b5e90751684127a5ceb5360afa19c0e9092c26
parent77be714e05948049439f1bbf506b3213be61f705 (diff)
downloadutil-linux-old-0d4b490f79de86caca250ba2fee936e37cf6ec31.tar.gz
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 <meyering@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r--libs/blkid/src/probers/ext.c5
1 files 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;