|author||Rich Felker <email@example.com>||2021-09-11 21:21:43 -0400|
|committer||Rich Felker <firstname.lastname@example.org>||2021-09-11 21:21:43 -0400|
fix undefined behavior in getdelim via null pointer arithmetic and memcpy
both passing a null pointer to memcpy with length 0, and adding 0 to a null pointer, are undefined. in some sense this is 'benign' UB, but having it precludes use of tooling that strictly traps on UB. there may be better ways to fix it, but conditioning the operations which are intended to be no-ops in the k==0 case on k being nonzero is a simple and safe solution.
Diffstat (limited to 'src/errno/strerror.c')
0 files changed, 0 insertions, 0 deletions