3 ms·
If len overflows and wraps (i.e. the sum of string lengths is > SIZE_MAX-1), you'll allocate less memory than is required and memcpy will write outside of buffe
by dchest 15y ago
If len overflows and wraps (i.e. the sum of string lengths is > SIZE_MAX-1), you'll allocate less memory than is required and memcpy will write outside of buffer bounds.
- tedunangst 15y agoWhile that may be possible in some segmented systems, it's worth noting that on just about any modern system having a set of strings bigger than all available memory is unlikely.