Bug 62056 - overflow_strfsize undefined behavior, fails to compile with GCC 8
Summary: overflow_strfsize undefined behavior, fails to compile with GCC 8
Status: NEW
Alias: None
Product: APR
Classification: Unclassified
Component: APR test (show other bugs)
Version: 1.6.3
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-29 18:09 UTC by Florian Weimer
Modified: 2018-01-29 18:09 UTC (History)
0 users



Attachments
Fix overflow check in overflow_strfsize (643 bytes, patch)
2018-01-29 18:09 UTC, Florian Weimer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Weimer 2018-01-29 18:09:11 UTC
Created attachment 35704 [details]
Fix overflow check in overflow_strfsize

off is signed, so checking for overflow by looking at wrapround to a negative value does not work—it is undefined behavior.
Comment 1 Florian Weimer 2018-01-29 18:09:32 UTC
Downstream bug: https://bugzilla.redhat.com/show_bug.cgi?id=1539844