Fixing wrong memory read problem detected by Valgrind in "xml" test.
The source of the problem was in my_vsnprintf() implementation. strings/my_vsnprintf.c: Fixing a problem in vsnprintf('%.*s', len, ptr) When processing the above format, it's incorrect to use strlen() because the string is not necessarily a null terminated string. Changing strlen() followed by set_if_smaller() to strnlen() - which covers both cases - limiting by '\0' and by "len".
Showing
Please register or sign in to comment