Blame SOURCES/wget-1.14-Fix-deadcode-and-possible-NULL-use.patch

a8b0b1
From 613d8639c48b950f76d132b70d27e518ba6d6891 Mon Sep 17 00:00:00 2001
a8b0b1
From: Tomas Hozza <thozza@redhat.com>
a8b0b1
Date: Fri, 26 Apr 2013 14:42:30 +0200
a8b0b1
Subject: [PATCH] Fix using deadcode and possible use of NULL pointer
a8b0b1
a8b0b1
Fix for deadcode in unique_create() so that "opened_name" parameter is
a8b0b1
always initialized to a valid string or NULL when returning from
a8b0b1
function.
a8b0b1
a8b0b1
Fix for redirect_output() so that "logfile" is not blindly used in
a8b0b1
fprintf() call and checked if it is not NULL.
a8b0b1
a8b0b1
Signed-off-by: Tomas Hozza <thozza@redhat.com>
a8b0b1
---
a8b0b1
 src/log.c   | 2 +-
a8b0b1
 src/utils.c | 2 +-
a8b0b1
 2 files changed, 2 insertions(+), 2 deletions(-)
a8b0b1
a8b0b1
diff --git a/src/log.c b/src/log.c
a8b0b1
index 0185df1..4f93a21 100644
a8b0b1
--- a/src/log.c
a8b0b1
+++ b/src/log.c
a8b0b1
@@ -871,7 +871,7 @@ redirect_output (void)
a8b0b1
          can do but disable printing completely. */
a8b0b1
       fprintf (stderr, _("\n%s received.\n"), redirect_request_signal_name);
a8b0b1
       fprintf (stderr, _("%s: %s; disabling logging.\n"),
a8b0b1
-               logfile, strerror (errno));
a8b0b1
+               (logfile) ? logfile : DEFAULT_LOGFILE, strerror (errno));
a8b0b1
       inhibit_logging = true;
a8b0b1
     }
a8b0b1
   save_context_p = false;
a8b0b1
diff --git a/src/utils.c b/src/utils.c
a8b0b1
index 567dc35..7cc942f 100644
a8b0b1
--- a/src/utils.c
a8b0b1
+++ b/src/utils.c
a8b0b1
@@ -703,7 +703,7 @@ unique_create (const char *name, bool binary, char **opened_name)
a8b0b1
       xfree (uname);
a8b0b1
       uname = unique_name (name, false);
a8b0b1
     }
a8b0b1
-  if (opened_name && fp != NULL)
a8b0b1
+  if (opened_name)
a8b0b1
     {
a8b0b1
       if (fp)
a8b0b1
         *opened_name = uname;
a8b0b1
-- 
a8b0b1
1.8.1.4
a8b0b1