Fix bug running readelf on an empty file. (#1903448)

This commit is contained in:
Nick Clifton 2021-01-08 17:48:06 +00:00
parent e056abea7e
commit eeeb57f8ed
2 changed files with 17 additions and 1 deletions

View File

@ -133,3 +133,13 @@
free (filedata->section_headers); free (filedata->section_headers);
free (filedata->program_headers); free (filedata->program_headers);
free (filedata->string_table); free (filedata->string_table);
--- binutils.orig/binutils/readelf.c 2021-01-08 17:01:23.573093204 +0000
+++ binutils-2.35.1/binutils/readelf.c 2021-01-08 17:02:23.095677242 +0000
@@ -20787,7 +20787,6 @@ process_file (char * file_name)
if (fread (armag, SARMAG, 1, filedata->handle) != 1)
{
error (_("Failed to read file's magic number\n"));
- fclose (filedata->handle);
goto done;
}

View File

@ -39,7 +39,7 @@
Summary: A GNU collection of binary utilities Summary: A GNU collection of binary utilities
Name: binutils%{?name_cross}%{?_with_debug:-debug} Name: binutils%{?name_cross}%{?_with_debug:-debug}
Version: 2.35.1 Version: 2.35.1
Release: 19%{?dist} Release: 20%{?dist}
License: GPLv3+ License: GPLv3+
URL: https://sourceware.org/binutils URL: https://sourceware.org/binutils
@ -874,6 +874,12 @@ exit 0
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
%changelog %changelog
* Fri Jan 08 2021 Nick Clifton <nickc@redhat.com> - 2.35.1-20
- Fix bug running readelf on an empty file. (#1903448)
* Thu Jan 07 2021 Nick Clifton <nickc@redhat.com> - 2.35.1-19
- Fix bug running readelf on a file that cannot be read. (#1913589)
* Mon Jan 04 2021 Nick Clifton <nickc@redhat.com> - 2.35.1-18 * Mon Jan 04 2021 Nick Clifton <nickc@redhat.com> - 2.35.1-18
- Fix linking with multiple same-name sections. (PR 27100) - Fix linking with multiple same-name sections. (PR 27100)