]> git.sesse.net Git - vlc/commitdiff
* modules/demux/asf/asf.c: Fixed a buffer overflow.
authorSam Hocevar <sam@videolan.org>
Mon, 22 Dec 2003 00:26:01 +0000 (00:26 +0000)
committerSam Hocevar <sam@videolan.org>
Mon, 22 Dec 2003 00:26:01 +0000 (00:26 +0000)
modules/demux/asf/asf.c

index d5ba74c5d2a63b9fc3b13d52ed620057f8762b03..d2a1639d8bfff7d4ea8e7d1fb504542bb5b806b3 100644 (file)
@@ -2,7 +2,7 @@
  * asf.c : ASFv01 file input module for vlc
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: asf.c,v 1.46 2003/11/23 13:15:27 gbazin Exp $
+ * $Id: asf.c,v 1.47 2003/12/22 00:26:01 sam Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -319,9 +319,10 @@ static int Open( vlc_object_t * p_this )
 
         if( p_sys->stream[i] )
         {
-            char psz_cat[sizeof(_("Stream "))+10];
-            sprintf( psz_cat, _("Stream %d"), i_stream );
+            char *psz_cat = malloc( strlen(_("Stream")) + 10 );
+            sprintf( psz_cat, "%s %d", _("Stream"), i_stream );
             p_cat = input_InfoCategory( p_input, psz_cat);
+            free( psz_cat );
 
             if( p_cl && i_stream < p_cl->i_codec_entries_count )
             {