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

Rémi Duraffort git at videolan.org
Mon Jul 2 14:37:08 CEST 2012


vlc/vlc-2.0 | branch: master | Rémi Duraffort <ivoire at videolan.org> | Mon Jun 25 11:19:05 2012 +0200| [4cfc4e981e706f1b220c102899ec469ff00c2857] | committer: Felix Paul Kühne

vcd: fix off-by-one while scanning

scanf("%Ns", %buffer) require the buffer to be N+1 long.
(cherry picked from commit da89d251fc076b1df3b0d8ba5987e16371a1a59a)

Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>

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

 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 d95c8fd..cda5515 100644
--- a/modules/access/vcd/cdrom.c
+++ b/modules/access/vcd/cdrom.c
@@ -819,7 +819,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