Have readelf return an exit failure status when attempting to process an empty file.

Resolves:  #1522732
This commit is contained in:
Nick Clifton 2017-12-06 12:28:02 +00:00
parent baa571c7e4
commit 3790a4edfd
2 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,6 @@
--- binutils.orig/binutils/readelf.c 2017-07-24 15:27:09.859116315 +0100
+++ binutils-2.29/binutils/readelf.c 2017-07-24 15:30:33.557770525 +0100
@@ -18414,39 +18414,49 @@ process_archive (char * file_name, FILE
@@ -18414,39 +18414,50 @@ process_archive (char * file_name, FILE
static bfd_boolean
process_file (char * file_name)
{
@ -56,6 +56,7 @@
+ error (_("Failed to read file's magic number\n"));
fclose (file);
- return FALSE;
+ ret = FALSE;
+ goto done;
}

View File

@ -54,7 +54,7 @@
Summary: A GNU collection of binary utilities
Name: %{?cross}binutils%{?_with_debug:-debug}
Version: 2.29
Release: 7%{?dist}
Release: 8%{?dist}
License: GPLv3+
Group: Development/Tools
URL: http://sources.redhat.com/binutils
@ -661,6 +661,9 @@ exit 0
#---------------------------------------------------------------------------------
%changelog
* Wed Dec 06 2017 Nick Clifton <nickc@redhat.com> 2.29-8
- Have readelf return an exit failure status when attempting to process an empty file. (#1522732)
* Fri Nov 17 2017 Nick Clifton <nickc@redhat.com> 2.29-7
- Import fix for PR 21884 which stops a seg-fault in the linker when changing output format to binary during a final link.
(#1491023)