Speex upstream added check in speex_packet_to_header(), so that can address this
problem for all affected apps, that use speex_packet_to_header and check its
return value (all applications seem to do that correctly). For caller of
speex_packet_to_header that does not check return value, it will reduce problem
to a crash caused by NULL pointer dereference.
Patch by kfish that checks for headers with invalid mode numbers. Technically,
it should have been the application's responsability, but many didn't, so
we ended up with security issues. Considering that there's no real use for
modes that Speex doesn't know about, this should workaround a lot of problems.
Speex upstream added check in speex_packet_ to_header( ), so that can address this to_header and check its to_header that does not check return value, it will reduce problem
problem for all affected apps, that use speex_packet_
return value (all applications seem to do that correctly). For caller of
speex_packet_
to a crash caused by NULL pointer dereference.
Patch applied to speex_packet_ to_header( ):
$ svn diff -c 14701 http:// svn.xiph. org/trunk/ speex/libspeex/ ======= ======= ======= ======= ======= ======= ======= ======= ==== SWITCH( le_header- >frames_ per_packet) ; SWITCH( le_header- >extra_ headers) ;
Index: speex_header.c
=======
--- speex_header.c (revision 14700)
+++ speex_header.c (revision 14701)
@@ -178,6 +178,13 @@
ENDIAN_
ENDIAN_
+ if (le_header->mode >= SPEEX_NB_MODES || le_header->mode < 0) "Invalid mode specified in Speex header"); >nb_channels> 2)
le_header- >nb_channels = 2; >nb_channels< 1)
+ {
+ speex_notify(
+ speex_free (le_header);
+ return NULL;
+ }
+
if (le_header-
if (le_header-
$ svn log -r 14701 http:// svn.xiph. org/trunk/ speex/libspeex/ ------- ------- ------- ------- ------- ------- ------- ------- ------- --
-------
r14701 | jm | 2008-04-11 05:48:46 +0200 (Fri, 11 Apr 2008) | 5 lines
Patch by kfish that checks for headers with invalid mode numbers. Technically,
it should have been the application's responsability, but many didn't, so
we ended up with security issues. Considering that there's no real use for
modes that Speex doesn't know about, this should workaround a lot of problems.
------- ------- ------- ------- ------- ------- ------- ------- ------- ------- --