[Mplayer-cvslog] CVS: main configure, 1.875, 1.876 playtree.c, 1.20, 1.21 subreader.c, 1.134, 1.135

Diego Biurrun CVS syncmail at mplayerhq.hu
Fri Jun 25 18:49:54 CEST 2004


CVS change done by Diego Biurrun CVS

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

Modified Files:
	configure playtree.c subreader.c 
Log Message:
string handling security fixes
patch by Nicholas Kain, Alexander Strasser <eclipse7 at gmx.net>
reviewed by Pontscho, Alex, Rich


Index: configure
===================================================================
RCS file: /cvsroot/mplayer/main/configure,v
retrieving revision 1.875
retrieving revision 1.876
diff -u -r1.875 -r1.876
--- configure	25 Jun 2004 16:17:16 -0000	1.875
+++ configure	25 Jun 2004 16:49:50 -0000	1.876
@@ -2712,6 +2712,34 @@
 fi
 echores "$_strsep"
 
+echocheck "strlcpy()"
+cat > $TMPC << EOF
+#include <string.h>
+int main (void) { char *s = "Hello, world!", t[20]; (void) strlcpy(t, s, sizeof( t )); return 0; }
+EOF
+_strlcpy=no
+cc_check && _strlcpy=yes
+if test "$_strlcpy" = yes ; then
+ _def_strlcpy='#define HAVE_STRLCPY 1'
+else
+ _def_strlcpy='#undef HAVE_STRLCPY'
+fi
+echores "$_strlcpy"
+
+echocheck "strlcat()"
+cat > $TMPC << EOF
+#include <string.h>
+int main (void) { char *s = "Hello, world!", t[20]; (void) strlcat(t, s, sizeof( t )); return 0; }
+EOF
+_strlcat=no
+cc_check && _strlcat=yes
+if test "$_strlcat" = yes ; then
+ _def_strlcat='#define HAVE_STRLCAT 1'
+else
+ _def_strlcat='#undef HAVE_STRLCAT'
+fi
+echores "$_strlcat"
+
 echocheck "fseeko()"
 cat > $TMPC << EOF
 #include <stdio.h>
@@ -6336,6 +6364,18 @@
 /* Define this if your system has strsep */
 $_def_strsep
 
+/* Define this if your system has strlcpy */
+$_def_strlcpy
+#ifndef HAVE_STRLCPY
+unsigned int strlcpy (char *dest, char *src, unsigned int size);
+#endif
+
+/* Define this if your system has strlcat */
+$_def_strlcat
+#ifndef HAVE_STRLCAT
+unsigned int strlcat (char *dest, char *src, unsigned int size);
+#endif
+
 /* Define this if your system has fseeko */
 $_def_fseeko
 #ifndef HAVE_FSEEKO

Index: playtree.c
===================================================================
RCS file: /cvsroot/mplayer/main/playtree.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- playtree.c	8 Jul 2003 10:45:05 -0000	1.20
+++ playtree.c	25 Jun 2004 16:49:51 -0000	1.21
@@ -936,7 +936,7 @@
 
 void pt_add_gui_file(play_tree_t** ppt, char* path, char* file)
 {
-  char* wholename = malloc(strlen(path)+strlen(file)+3);
+  char* wholename = malloc(strlen(path)+strlen(file)+2);
 
   if (wholename)
   {

Index: subreader.c
===================================================================
RCS file: /cvsroot/mplayer/main/subreader.c,v
retrieving revision 1.134
retrieving revision 1.135
diff -u -r1.134 -r1.135
--- subreader.c	21 May 2004 16:02:09 -0000	1.134
+++ subreader.c	25 Jun 2004 16:49:51 -0000	1.135
@@ -1133,7 +1133,7 @@
   while (l){
      char *ip = icbuffer;
      char *op = sub->text[--l];
-     strcpy(ip, op);
+     strlcpy(ip, op, ICBUFFSIZE);
      ileft = strlen(ip);
      oleft = ICBUFFSIZE - 1;
 		




More information about the MPlayer-cvslog mailing list