[vlc-devel] commit: SAP: remotely trigerrable memory leak (CID #70) ( Rémi Denis-Courmont )

git version control git at videolan.org
Tue Jul 1 21:37:42 CEST 2008


vlc | branch: 0.8.6-bugfix | Rémi Denis-Courmont <rdenis at simphalempin.com> | Tue Jul  1 22:39:33 2008 +0300| [8f937a9b7bb90e20b966fb3077c4bd81ecb13929]

SAP: remotely trigerrable memory leak (CID #70)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8f937a9b7bb90e20b966fb3077c4bd81ecb13929
---

 modules/services_discovery/sap.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/services_discovery/sap.c b/modules/services_discovery/sap.c
index 3d664de..f7723d6 100644
--- a/modules/services_discovery/sap.c
+++ b/modules/services_discovery/sap.c
@@ -771,10 +771,15 @@ static int ParseSAP( services_discovery_t *p_sd, uint8_t *p_buffer, int i_read )
         p_sd->p_sys->b_parse == VLC_FALSE )
     {
         if( p_sdp->psz_uri ) free( p_sdp->psz_uri );
-        asprintf( &p_sdp->psz_uri, "sdp://%s", p_sdp->psz_sdp );
+        if( asprintf( &p_sdp->psz_uri, "sdp://%s", p_sdp->psz_sdp ) == -1 )
+            p_sdp->psz_uri = NULL;
     }
 
-    if( p_sdp->psz_uri == NULL ) return VLC_EGENERIC;
+    if( p_sdp->psz_uri == NULL )
+    {
+        FreeSDP( p_sdp );
+        return VLC_EGENERIC;
+    }
 
     for( i = 0 ; i< p_sd->p_sys->i_announces ; i++ )
     {




More information about the vlc-devel mailing list