mpv/misc
low-batt 6d208d38d2 charset_conv: fix memory corruption in mp_iconv_to_utf8
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
2023-04-29 01:37:41 +00:00
..
bstr.c bstr: remove unused bstr_splitlines() function 2019-12-23 11:01:56 +01:00
bstr.h bstr: remove unused bstr_splitlines() function 2019-12-23 11:01:56 +01:00
charset_conv.c charset_conv: fix memory corruption in mp_iconv_to_utf8 2023-04-29 01:37:41 +00:00
charset_conv.h osx: consistent normalisation when searching for external files 2017-02-02 16:21:04 +01:00
ctype.h Audit and replace all ctype.h uses 2014-07-01 23:11:08 +02:00
dispatch.c dispatch: add strange mechanism for making worker threads responsive 2020-03-05 22:00:50 +01:00
dispatch.h dispatch: add strange mechanism for making worker threads responsive 2020-03-05 22:00:50 +01:00
jni.c misc: add jni helpers 2019-11-19 12:10:26 -08:00
jni.h misc: add jni helpers 2019-11-19 12:10:26 -08:00
json.c misc/json: don't wrap top-level pretty strings/infs in quotes 2023-01-28 14:20:20 -06:00
json.h m_option: pretty print mpv_node for OSD 2017-10-30 15:32:24 +01:00
linked_list.h misc: add linked list helpers 2018-05-24 19:56:35 +02:00
natural_sort.c demux: sort filenames naturally when playing a directory / archive 2019-09-29 01:13:00 +03:00
natural_sort.h demux: sort filenames naturally when playing a directory / archive 2019-09-29 01:13:00 +03:00
node.c misc/node: add bstr-based variants for map_get() and map_add() 2023-01-28 14:20:20 -06:00
node.h misc/node: add bstr-based variants for map_get() and map_add() 2023-01-28 14:20:20 -06:00
random.c misc/random: add xoshiro random number implementation 2022-08-17 10:21:55 -04:00
random.h various: fix various typos in the code base 2023-03-28 19:29:44 +00:00
rendezvous.c rendezvous: fix a typo 2018-08-31 11:40:33 +02:00
rendezvous.h Add Plan 9-style barriers 2014-07-26 20:29:48 +02:00
thread_pool.c osdep: rename MP_UNREACHABLE 2021-11-03 15:15:20 +01:00
thread_pool.h thread_pool: add a helper function 2018-05-24 19:56:35 +02:00
thread_tools.c player: some further cleanup of the mp_cancel crap 2018-05-24 19:56:35 +02:00
thread_tools.h player: some further cleanup of the mp_cancel crap 2018-05-24 19:56:35 +02:00