[Bug libstdc++/47921] pbump will overflow when input n is larger than 2G-1

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Feb 28 12:42:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47921

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-02-28 12:36:28 UTC ---
We can't change the signature of pbump, but that doesn't mean we have to call
it with values that cause overflow. Could we add a safe_pbump(streamsize n)
which calls pbump in a loop so it doesn't call it with a value outside the
range of an int?



More information about the Gcc-bugs mailing list