From 15cc7dd182a6be79cbb01a5de4f13e958717bd69 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 16 May 2011 09:10:36 -0400 Subject: [PATCH] Fix test for error_one_per_line mode in error --- ChangeLog | 5 +++++ NEWS | 2 +- misc/error.c | 6 ++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index a80468a9e0..c04155975d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2011-05-16 Ulrich Drepper + [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. diff --git a/NEWS b/NEWS index 3fe6c9d5d3..ef27e60428 100644 --- a/NEWS +++ b/NEWS @@ -16,7 +16,7 @@ Version 2.14 12510, 12511, 12518, 12527, 12541, 12545, 12551, 12582, 12583, 12587, 12597, 12601, 12611, 12625, 12626, 12631, 12650, 12653, 12655, 12660, 12681, 12685, 12711, 12713, 12714, 12717, 12723, 12724, 12734, 12738, - 12746 + 12746, 12766 * The RPC implementation in libc is obsoleted. Old programs keep working but new programs cannot be linked with the routines in libc anymore. diff --git a/misc/error.c b/misc/error.c index 85d1cffbf9..9a73a61c74 100644 --- a/misc/error.c +++ b/misc/error.c @@ -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;