Blame SOURCES/0013-coverity-Check-null-pointer-before-dereferencing-it-.patch

8256c5
From 570496fa4d39fd5eaa6216c7962c3875794571c2 Mon Sep 17 00:00:00 2001
8256c5
From: Martin Kutlak <mkutlak@redhat.com>
8256c5
Date: Mon, 20 Aug 2018 16:13:15 +0200
8256c5
Subject: [PATCH] coverity: Check null pointer before dereferencing it #def35
8256c5
8256c5
Signed-off-by: Martin Kutlak <mkutlak@redhat.com>
8256c5
---
8256c5
 src/lib/xatonum.c | 2 +-
8256c5
 1 file changed, 1 insertion(+), 1 deletion(-)
8256c5
8256c5
diff --git a/src/lib/xatonum.c b/src/lib/xatonum.c
8256c5
index 510d7667..8381ec37 100644
8256c5
--- a/src/lib/xatonum.c
8256c5
+++ b/src/lib/xatonum.c
8256c5
@@ -96,7 +96,7 @@ int xatoi_positive(const char *numstr)
8256c5
 
8256c5
 int try_atoi(const char *numstr, int *value)
8256c5
 {
8256c5
-    if (*numstr != '-')
8256c5
+    if (numstr != NULL && *numstr != '-')
8256c5
         return try_atoi_positive(numstr, value);
8256c5
 
8256c5
     unsigned tmp;
8256c5
-- 
8256c5
2.17.1
8256c5