#26 Fix return value of process_file (#1990817)
Closed 2 months ago by jwakely. Opened 2 months ago by jwakely.
rpms/ jwakely/binutils rhbz1990817  into  rawhide

@@ -1,9 +1,11 @@ 

  --- binutils.orig/binutils/readelf.c	2021-07-19 12:39:14.206556025 +0100

  +++ binutils-2.37/binutils/readelf.c	2021-07-19 12:44:37.712728732 +0100

- @@ -21873,45 +21873,52 @@ process_file (char * file_name)

+ @@ -21872,46 +21872,53 @@ process_file (char * file_name)

+    Filedata * filedata = NULL;

     struct stat statbuf;

     char armag[SARMAG];

-    bool ret = true;

+ -  bool ret = true;

+ +  bool ret = false;

  +  char * name;

  +  char * saved_program_name;

  +

file modified
+4 -1
@@ -39,7 +39,7 @@ 

  Summary: A GNU collection of binary utilities

  Name: binutils%{?name_cross}%{?_with_debug:-debug}

  Version: 2.37

- Release: 3%{?dist}

+ Release: 4%{?dist}

  License: GPLv3+

  URL: https://sourceware.org/binutils

  
@@ -869,6 +869,9 @@ 

  

  #----------------------------------------------------------------------------

  %changelog

+ * Fri Aug 06 2021 Jonathan Wakely <jwakely@redhat.com> - 2.37-4

+ - Fix return value of process_file (#1990817)

+ 

  * Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.37-3

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

  

When this package was rebased to the upstream 2.37 release, the
binutils-filename-in-error-messages.patch local patch had to be rebased,
because upstream changed from using bfd_boolean, TRUE and FALSE to using
C99 bool, with true and false.

The upstream code changed like so:

-  bfd_boolean ret = TRUE;
+  bool ret = true;

However, Fedora had a local change to use FALSE there, which was lost in
the rebase, so we just use true now, causing the function to return
true in case of error.

This restores the intended behaviour of the Fedora patch, by
initializing the variable to false.

This fixes the bug, but is missing tests to verify it. There should really
be upstream tests for the exit code of readelf, which would then
get reused downstream and verify the local patches still pass them.

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

Fixed by f4ad579 instead (although I think it makes more sense to fix the incorrect rebase in binutils-filename-in-error-messages.patch rather than add a second patch to fix the result of the first one).

Pull-Request has been closed by jwakely

2 months ago