From 357cae102b2994f1874f5691dc571543111bd5fa Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Fri, 2 Sep 2016 08:38:57 +0200 Subject: [PATCH] df plugin: Guard strcmp() against being passed NULL pointers. Issue: #1835 --- src/df.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/df.c b/src/df.c index 4a86799c..af54c92f 100644 --- a/src/df.c +++ b/src/df.c @@ -229,7 +229,10 @@ static int df_read (void) } /* Duplicate found: leave non-NULL dup_ptr. */ - if (by_device && (strcmp (mnt_ptr->spec_device, dup_ptr->spec_device) == 0)) + if (by_device + && (mnt_ptr->spec_device != NULL) + && (dup_ptr->spec_device != NULL) + && (strcmp (mnt_ptr->spec_device, dup_ptr->spec_device) == 0)) break; else if (!by_device && (strcmp (mnt_ptr->dir, dup_ptr->dir) == 0)) break; -- 2.11.0