3 ms·
BString relies on undefined behavior for security: The reason is it is resiliant to length overflows is that bstring lengths are bounded above by INT_MAX,
by clarry 13y ago
BString relies on undefined behavior for security:
The reason is it is resiliant to length overflows is that
bstring lengths are bounded above by INT_MAX, instead of
~(size_t)0. So length addition overflows cause a wrap
around of the integer value making them negative causing
balloc() to fail before an erroneous operation can occurr.
I wouldn't touch this library.