]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix test for error_one_per_line mode in error
authorUlrich Drepper <drepper@gmail.com>
Mon, 16 May 2011 13:10:36 +0000 (14:10 +0100)
committerPetr Baudis <pasky@ucw.cz>
Thu, 26 May 2011 23:39:26 +0000 (01:39 +0200)
(cherry picked from commit 15cc7dd182a6be79cbb01a5de4f13e958717bd69)

ChangeLog
misc/error.c

index 0609c9183aa1b19856e44b688136a60b443a2b32..1dbb1767551c2761868b35f7f5c2a1ab33d5a787 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-05-16  Ulrich Drepper  <drepper@gmail.com>
 
+       [BZ #12766]
+       * misc/error.c (error_at_line): Ensure file_name and old_file_name
+       point to strings before performing equality test for error_one_per_line
+       mode.
+
        [BZ #11697]
        * login/programs/pt_chown.c (do_pt_chown): Always call chown.
 
index 85d1cffbf931536978a0076d275d1a160b695ab9..9a73a61c74cb906e44be5e7a474f27ca12e84888 100644 (file)
@@ -1,5 +1,5 @@
 /* Error handler for noninteractive utilities
-   Copyright (C) 1990-1998, 2000-2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1990-1998, 2000-2006, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -272,7 +272,9 @@ error_at_line (int status, int errnum, const char *file_name,
 
       if (old_line_number == line_number
          && (file_name == old_file_name
-             || strcmp (old_file_name, file_name) == 0))
+             || (old_file_name != NULL
+                 && file_name != NULL
+                 && strcmp (old_file_name, file_name) == 0)))
        /* Simply return and print nothing.  */
        return;