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

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