]> git.sesse.net Git - vlc/commit
modules/services_discovery/sap.c: avoid out-of-bounds write
authorNickolai Zeldovich <nickolai@csail.mit.edu>
Thu, 17 Jan 2013 01:03:20 +0000 (20:03 -0500)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 17 Jan 2013 16:52:03 +0000 (18:52 +0200)
commitdee928705dd32839317dca0e77089b02dd720763
treeea65bc55d58a1e2c614f1f854387e96389649aed
parent301c200aa93c637d9896a0f71f03e856a6daf2b7
modules/services_discovery/sap.c: avoid out-of-bounds write

After OpenDemux reads data using stream_Read(), it writes a '\0' to
the buffer after the newly-read data, but if the stream returned exactly
i_read_max bytes, this '\0' will end up just past the end of the allocated
psz_sdp array (see the call to realloc at the beginning of the loop).
Adjust the realloc call to allocate this one extra byte.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
modules/services_discovery/sap.c