[vlc-commits] stream_out/raop: WriteAuxHeaders: prevent potential null-dereference
Filip Roséen
git at videolan.org
Thu May 18 21:08:30 CEST 2017
vlc | branch: master | Filip Roséen <filip at atch.se> | Thu May 18 12:19:26 2017 +0200| [cc6b26797d19a5eae1e712d6607ead34a69c12a3] | committer: Jean-Baptiste Kempf
stream_out/raop: WriteAuxHeaders: prevent potential null-dereference
vlc_dictionary_all_keys returns NULL on error, meaning that the
previous implementation could result in a null-pointer dereference.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cc6b26797d19a5eae1e712d6607ead34a69c12a3
---
modules/stream_out/raop.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/modules/stream_out/raop.c b/modules/stream_out/raop.c
index 48b7cd18f6..0903fc9ac0 100644
--- a/modules/stream_out/raop.c
+++ b/modules/stream_out/raop.c
@@ -722,6 +722,10 @@ static void WriteAuxHeaders( struct vlc_memstream *restrict stream,
vlc_dictionary_t *p_req_headers )
{
char **ppsz_keys = vlc_dictionary_all_keys( p_req_headers );
+
+ if( unlikely( !ppsz_keys ) )
+ return;
+
for( size_t i = 0; ppsz_keys[i] != NULL; i++ )
{
char *name = ppsz_keys[i];
More information about the vlc-commits
mailing list