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

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