[PATCH] Tighten length error check in string::replace

Paolo Carlini pcarlini@unitus.it
Thu Apr 25 16:25:00 GMT 2002


Paolo Carlini wrote:

> Notice, moreover, that (my bad!) the current test (__size - __n1 > 
> this->max_size() - __n2) for sure is not self-consistent, since both 
> __size and __n1 are unsigned quantities and therefore if the user 
> specifies __n1 > __size (he can, is up to the library to fold the 
> value) false positives may result from the comparison. 

Thinking more about this, I'm finding this bug pretty serious and would 
even ask for having it 3.1.0, if still possible.

Thanks again,
Paolo.




More information about the Libstdc++ mailing list