Open smcv opened 1 year ago
The solution would probably involve using strncpy
instead of memcpy
to copy into each item src_x[x]
, and then setting the last byte src[x][w - 1]
to \0
(because strncpy
can leave a string unterminated, if truncation occurs).
While testing #305 I found an unrelated memory error in
t/image_xpm_array.t
. If I'm reading correctly, it's continuing to copy bytes beyond the\0
termination of each string in the array. This is undefined behaviour and can lead to crashes, although in practice it doesn't seem to crash on any of Debian's autobuilders.