[vlc-commits] vcd: fix off-by-one while scanning

Rémi Duraffort git at videolan.org
Thu Jun 28 20:13:45 CEST 2012


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Mon Jun 25 11:19:05 2012 +0200| [da89d251fc076b1df3b0d8ba5987e16371a1a59a] | committer: Rémi Duraffort

vcd: fix off-by-one while scanning

scanf("%Ns", %buffer) require the buffer to be N+1 long.

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

 modules/access/vcd/cdrom.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/access/vcd/cdrom.c b/modules/access/vcd/cdrom.c
index 2b67466..796c247 100644
--- a/modules/access/vcd/cdrom.c
+++ b/modules/access/vcd/cdrom.c
@@ -802,7 +802,7 @@ static int OpenVCDImage( vlc_object_t * p_this, const char *psz_dev,
     while( fgets( line, 1024, cuefile ) && i_tracks < INT_MAX-1 )
     {
         /* look for a TRACK line */
-        char psz_dummy[9];
+        char psz_dummy[10];
         if( !sscanf( line, "%9s", psz_dummy ) || strcmp(psz_dummy, "TRACK") )
             continue;
 



More information about the vlc-commits mailing list