Fix bug running readelf on a file that cannot be read.

Resolves: #1913589
This commit is contained in:
Nick Clifton 2021-01-07 14:20:35 +00:00
parent 5aee897b5c
commit e056abea7e
2 changed files with 13 additions and 1 deletions

View File

@ -121,3 +121,15 @@
free (ba_cache.strtab);
ba_cache.strtab = NULL;
--- binutils.orig/binutils/readelf.c 2021-01-07 12:59:35.802994842 +0000
+++ binutils-2.35.1/binutils/readelf.c 2021-01-07 13:02:36.591754005 +0000
@@ -20818,7 +20818,8 @@ process_file (char * file_name)
done:
if (filedata)
{
- fclose (filedata->handle);
+ if (filedata->handle != NULL)
+ fclose (filedata->handle);
free (filedata->section_headers);
free (filedata->program_headers);
free (filedata->string_table);

View File

@ -39,7 +39,7 @@
Summary: A GNU collection of binary utilities
Name: binutils%{?name_cross}%{?_with_debug:-debug}
Version: 2.35.1
Release: 18%{?dist}
Release: 19%{?dist}
License: GPLv3+
URL: https://sourceware.org/binutils