[vlc-commits] [Git][videolan/vlc][master] lib: media: fix use-after-free

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Mon Dec 13 09:21:10 UTC 2021



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
e71404e5 by Thomas Guillem at 2021-12-13T10:04:37+01:00
lib: media: fix use-after-free

Regression from c9ab8bd8ef2fb4ae92dd4b22946ba110d1cce07a

Fixes #26367

- - - - -


1 changed file:

- lib/media.c


Changes:

=====================================
lib/media.c
=====================================
@@ -866,10 +866,13 @@ libvlc_media_get_stat( libvlc_media_t *p_md, unsigned type, uint64_t *out )
 
     char *end;
     unsigned long long val = strtoull( str, &end, 10 );
-    free( str );
 
     if( *end != '\0' )
+    {
+        free( str );
         return -1;
+    }
+    free( str );
 
     *out = val;
     return 1;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/e71404e5c6057ac60e78fa647b7b4ed4e2b9d71e

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/e71404e5c6057ac60e78fa647b7b4ed4e2b9d71e
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list