[Bug c/86137] ubsan runtime error in c-format.c

2021-09-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86137

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #2 from Andrew Pinski  ---
Fixed already.  Dup of bug 89495.

*** This bug has been marked as a duplicate of bug 89495 ***

[Bug c/86137] ubsan runtime error in c-format.c

2018-06-13 Thread joseph at codesourcery dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86137

--- Comment #1 from joseph at codesourcery dot com  ---
Yes, this code needs to be fixed to avoid undefined overflow (if argnum > 
INT_MAX / 10 || (argnum == INT_MAX / 10 && *fcp - '0' > INT_MAX % 10), 
record that overflow has occurred and don't do the arithmetic on argnum).