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

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