[vlc-devel] commit: Fix use-after-free (CID 130) ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat May 31 21:54:57 CEST 2008


vlc | branch: 0.8.6-bugfix | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sat May 31 22:52:43 2008 +0300| [b5befe56d3843c8a21d1d07005f52f82f0895314]

Fix use-after-free (CID 130)

Does not affect master

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

 modules/misc/network/ipv6.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/misc/network/ipv6.c b/modules/misc/network/ipv6.c
index 9153cb8..1204097 100644
--- a/modules/misc/network/ipv6.c
+++ b/modules/misc/network/ipv6.c
@@ -350,7 +350,6 @@ mldv1:
             if( psz_mif != NULL )
             {
                 int intf = if_nametoindex( psz_mif );
-                free( psz_mif  );
 
                 if( intf != 0 )
                 {
@@ -359,8 +358,9 @@ mldv1:
                     {
                         msg_Err( p_this, "%s as multicast interface: %s",
                                  psz_mif, strerror(errno) );
+                        free( psz_mif  );
                         close( i_handle );
-                        return 0;
+                        i_handle = -1;
                     }
                 }
                 else
@@ -368,8 +368,11 @@ mldv1:
                     msg_Err( p_this, "%s: bad IPv6 interface specification",
                              psz_mif );
                     close( i_handle );
-                    return 0;
+                    i_handle = -1;
                 }
+                free( psz_mif );
+                if( i_handle == -1 )
+                    return 0;
             }
         }
     }




More information about the vlc-devel mailing list