mirror of https://github.com/mpv-player/mpv
6d208d38d2
If mp_iconv_to_utf8 was given an empty string to convert in the buf parameter it would corrupt memory when writing a null into outbuf before returning it to the caller. This happened when streaming from a URL that ends in a slash. For such a URL the method mp_basename returns an empty string. The method append_dir_subtitles passes the result returned from mp_basename to mp_iconv_to_utf8 which then corrupts memory. This was detected using Guard Malloc. The fix changes mp_iconv_to_utf8 check up front if buf is empty and if it is return buf as the result in compliance with the documented behavior of the method when no conversion is needed. Fixes #11626 |
||
---|---|---|
.. | ||
bstr.c | ||
bstr.h | ||
charset_conv.c | ||
charset_conv.h | ||
ctype.h | ||
dispatch.c | ||
dispatch.h | ||
jni.c | ||
jni.h | ||
json.c | ||
json.h | ||
linked_list.h | ||
natural_sort.c | ||
natural_sort.h | ||
node.c | ||
node.h | ||
random.c | ||
random.h | ||
rendezvous.c | ||
rendezvous.h | ||
thread_pool.c | ||
thread_pool.h | ||
thread_tools.c | ||
thread_tools.h |