]> git.sesse.net Git - vlc/commitdiff
* drms.c: Check that key store is at least 4 bytes (fixes segfault
authorJon Lech Johansen <jlj@videolan.org>
Wed, 12 May 2004 21:44:59 +0000 (21:44 +0000)
committerJon Lech Johansen <jlj@videolan.org>
Wed, 12 May 2004 21:44:59 +0000 (21:44 +0000)
            on empty key store).

modules/demux/mp4/drms.c

index 647e96b0bea1ec184c473484bd442c7f5a522215..e3eb677569baa66956cc7ba3503cb0d672b58b92 100644 (file)
@@ -1799,7 +1799,7 @@ static int GetSCIData( char *psz_ipod, uint32_t **pp_sci,
     {
         struct stat st;
 
-        if( !fstat( fileno( file ), &st ) )
+        if( !fstat( fileno( file ), &st ) && st.st_size >= 4 )
         {
             *pp_sci = malloc( st.st_size );
             if( *pp_sci != NULL )