[MPlayer-cvslog] CVS: main parser-mpcmd.c,1.24,1.25

Reimar Döffinger CVS syncmail at mplayerhq.hu
Fri Apr 14 23:51:48 CEST 2006


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main
In directory mail:/var2/tmp/cvs-serv16113

Modified Files:
	parser-mpcmd.c 
Log Message:
avoid crash when running "mplayer -loop" (dereferencing uninitialize pointer).


Index: parser-mpcmd.c
===================================================================
RCS file: /cvsroot/mplayer/main/parser-mpcmd.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- parser-mpcmd.c	24 Jan 2006 11:34:24 -0000	1.24
+++ parser-mpcmd.c	14 Apr 2006 21:51:45 -0000	1.25
@@ -140,9 +140,9 @@
 	if(strcasecmp(opt,"loop") == 0 &&
 		  (! last_entry || last_entry->child) ) {
 	  int l;
-	  char* end;
+	  char* end = NULL;
 	  l = (i+1<argc) ? strtol(argv[i+1],&end,0) : 0;
-	  if(*end != '\0') {
+	  if(!end || *end != '\0') {
 	    mp_msg(MSGT_CFGPARSER, MSGL_ERR, "The loop option must be an integer: %s\n",argv[i+1]);
 	    tmp = ERR_OUT_OF_RANGE;
 	  } else {




More information about the MPlayer-cvslog mailing list