Blame SOURCES/0040-Fix-a-pair-of-defects-uncovered-by-coverity.patch

f9a98e
From c4d4ecdad1259aab4c27db291e1dfcef0b1a6a51 Mon Sep 17 00:00:00 2001
f9a98e
From: Jakub Filak <jfilak@redhat.com>
f9a98e
Date: Wed, 22 Jan 2014 15:33:50 +0100
f9a98e
Subject: [PATCH 40/40] Fix a pair of defects uncovered by coverity
f9a98e
f9a98e
Resolves rhbz#1056584
f9a98e
---
f9a98e
 src/abrt-checker.c | 8 ++++++--
f9a98e
 src/jthread_map.c  | 1 +
f9a98e
 2 files changed, 7 insertions(+), 2 deletions(-)
f9a98e
f9a98e
diff --git a/src/abrt-checker.c b/src/abrt-checker.c
f9a98e
index 91485e0..713053c 100644
f9a98e
--- a/src/abrt-checker.c
f9a98e
+++ b/src/abrt-checker.c
f9a98e
@@ -2886,7 +2886,11 @@ void parse_commandline_options(char *options)
f9a98e
         }
f9a98e
         else if (strcmp("executable", key) == 0)
f9a98e
         {
f9a98e
-            if (strcmp("threadclass", value) == 0)
f9a98e
+            if (NULL == value || '\0' == value[0])
f9a98e
+            {
f9a98e
+                fprintf(stderr, "A value of '%s' option cannot be empty\n", key);
f9a98e
+            }
f9a98e
+            else if (strcmp("threadclass", value) == 0)
f9a98e
             {
f9a98e
                 VERBOSE_PRINT("Use a thread class for 'executable'\n");
f9a98e
                 executableFlags |= ABRT_EXECUTABLE_THREAD;
f9a98e
@@ -2899,7 +2903,7 @@ void parse_commandline_options(char *options)
f9a98e
             }
f9a98e
             else
f9a98e
             {
f9a98e
-                fprintf(stderr, "Unknown 'executable' option's value '%s'\n", key);
f9a98e
+                fprintf(stderr, "Unknown '%s' option's value '%s'\n", key, value);
f9a98e
             }
f9a98e
         }
f9a98e
         else
f9a98e
diff --git a/src/jthread_map.c b/src/jthread_map.c
f9a98e
index 4517398..4cb417b 100644
f9a98e
--- a/src/jthread_map.c
f9a98e
+++ b/src/jthread_map.c
f9a98e
@@ -55,6 +55,7 @@ T_jthreadMap *jthread_map_new()
f9a98e
     if (NULL == map)
f9a98e
     {
f9a98e
         fprintf(stderr, __FILE__ ":" STRINGIZE(__LINE__) ": calloc() error\n");
f9a98e
+        return NULL;
f9a98e
     }
f9a98e
 
f9a98e
     pthread_mutex_init(&map->mutex, /*use default attributes*/NULL);
f9a98e
-- 
f9a98e
1.8.3.1
f9a98e