[Bug binutils/29194] bfd/doc/chew.c error: ISO C forbids conversion of function pointer to object pointer type

2022-05-30 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=29194

--- Comment #4 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Alan Modra :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=eab286a7c8d990cce4d01a5c30cfe1c06823217b

commit eab286a7c8d990cce4d01a5c30cfe1c06823217b
Author: Alan Modra 
Date:   Mon May 30 17:04:53 2022 +0930

Use a union to avoid casts in bfd/doc/chew.c

This fixes -Wpedantic warnings in chew.c.  Conversion between function
and object pointers is not guaranteed.  They can even be different
sizes, not that we're likely to encounter build machines like that
nowadays.

PR 29194
* doc/chew.c (pcu): New union typedef.
(dict_type, pc): Use it here.  Adjust uses of pc.
(add_to_definition): Make "word" param a pcu.  Adjust all uses
of function.
(stinst_type): Delete.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/29194] bfd/doc/chew.c error: ISO C forbids conversion of function pointer to object pointer type

2022-05-30 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=29194

Alan Modra  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Alan Modra  ---
chew.c was in need of modernisation

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/29194] bfd/doc/chew.c error: ISO C forbids conversion of function pointer to object pointer type

2022-05-30 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=29194

Alan Modra  changed:

   What|Removed |Added

   Target Milestone|--- |2.39

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/29200] New: Infinite loop in nm-new

2022-05-30 Thread abhishah212 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=29200

Bug ID: 29200
   Summary: Infinite loop in nm-new
   Product: binutils
   Version: 2.36.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: abhishah212 at gmail dot com
  Target Milestone: ---

Created attachment 14122
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14122&action=edit
infinite loop artifacts

We found an infinite loop in `nm`. We describe our best effort to understand
the vulnerability below. We attach the relevant files as well. 

*Location* 
https://github.com/bminor/binutils-gdb/blob/binutils-2_36-branch/libiberty/cp-demangle.c#L1548

*Description*
While loop never terminates, as the intermediate conditional statements are not
satisfied. 

*Fix*
Convert while loop to a bounded for loop statement.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/29201] New: Stack Overflow Infinite Recursion in nm-new

2022-05-30 Thread abhishah212 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=29201

Bug ID: 29201
   Summary: Stack Overflow Infinite Recursion in nm-new
   Product: binutils
   Version: 2.36.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: abhishah212 at gmail dot com
  Target Milestone: ---

Created attachment 14123
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14123&action=edit
poc for stack overflow

We found a stack overflow resulting from a unbounded recursion in `nm-ew`. We
discuss our understanding of the vulnerability below. We attach the relevant
files as well. 

*Location* 
https://github.com/bminor/binutils-gdb/blob/binutils-2_36-branch/libiberty/rust-demangle.c#L696

*Description*
Recursive call to demangle_path never hits base case.

*Fix*
Attach a recursion depth for recursive function.

-- 
You are receiving this mail because:
You are on the CC list for the bug.