StringBuilder& operator<<( int x )
{ return SBNUM( x , 11 , "%d" ); }One of the longest signed integers is -2147483648, which is 11 bytes to print. And sprintf will add a null byte as a terminator, so 12 total bytes need to be allocated.
I'd recommend checking the other max sizes passed to SBNUM and also switching to snprintf and checking its return value to ensure the 'n' limit isn't exceeded at runtime.
- is depended on by
-
SERVER-4192 double free seen after update by id
- Closed
- is duplicated by
-
SERVER-6488 Server crash
- Closed
-
SERVER-4249 abort after invalid next size error
- Closed
- related to
-
SERVER-4249 abort after invalid next size error
- Closed