• unknown's avatar
    Fixing wrong memory read problem detected by Valgrind in "xml" test. · 42eab5a2
    unknown authored
    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".
    42eab5a2
my_vsnprintf.c 5.68 KB