sas Sat Sep 20 08:45:06 2003 EDT
Modified files:
/php-src/sapi/thttpdthttpd_patch
Log:
Fix potential buffer overrun
Index: php-src/sapi/thttpd/thttpd_patch
diff -u php-src/sapi/thttpd/thttpd_patch:1.43 php-src/sapi/thttpd/thttpd_patch:1.44
--- php-src/sapi/thttpd/thttpd_patch:1.43 Mon Jun 16 15:11:33 2003
+++ php-src/sapi/thttpd/thttpd_patchSat Sep 20 08:45:05 2003
@@ -1,6 +1,6 @@
diff -ur thttpd-2.21b/Makefile.in thttpd-2.21b-cool/Makefile.in
--- thttpd-2.21b/Makefile.in Thu Mar 29 20:36:21 2001
-+++ thttpd-2.21b-cool/Makefile.in Mon Jun 16 21:08:05 2003
thttpd-2.21b-cool/Makefile.in Sat Sep 20 14:43:20 2003
@@ -46,13 +46,15 @@
# You shouldn't need to edit anything below here.
@@ -40,7 +40,7 @@
diff -ur thttpd-2.21b/config.h thttpd-2.21b-cool/config.h
--- thttpd-2.21b/config.h Mon Apr 9 23:57:36 2001
-+++ thttpd-2.21b-cool/config.h Mon Jun 16 21:08:05 2003
thttpd-2.21b-cool/config.h Sat Sep 20 14:43:20 2003
@@ -82,6 +82,11 @@
*/
#define IDLE_READ_TIMELIMIT 60
@@ -64,7 +64,7 @@
** index pages for directories that don't have an explicit index file.
diff -ur thttpd-2.21b/configure thttpd-2.21b-cool/configure
--- thttpd-2.21b/configure Sat Apr 21 02:07:14 2001
-+++ thttpd-2.21b-cool/configureMon Jun 16 21:08:05 2003
thttpd-2.21b-cool/configureSat Sep 20 14:43:20 2003
@@ -1021,7 +1021,7 @@
fi
echo $ac_t$CPP 16
@@ -76,7 +76,7 @@
echo $ac_n checking for $ac_hdr... $ac_c 16
diff -ur thttpd-2.21b/configure.in thttpd-2.21b-cool/configure.in
--- thttpd-2.21b/configure.in Sat Apr 21 02:06:23 2001
-+++ thttpd-2.21b-cool/configure.in Mon Jun 16 21:08:05 2003
thttpd-2.21b-cool/configure.in Sat Sep 20 14:43:20 2003
@@ -64,7 +64,7 @@
AC_MSG_RESULT(no)
fi
@@ -88,7 +88,7 @@
diff -ur thttpd-2.21b/fdwatch.c thttpd-2.21b-cool/fdwatch.c
--- thttpd-2.21b/fdwatch.c Fri Apr 13 07:36:08 2001
-+++ thttpd-2.21b-cool/fdwatch.cMon Jun 16 21:08:05 2003
thttpd-2.21b-cool/fdwatch.cSat Sep 20 14:43:20 2003
@@ -419,6 +419,7 @@
if ( pollfds == (struct pollfd*) 0 || poll_fdidx == (int*) 0 ||
poll_rfdidx == (int*) 0 )
@@ -119,7 +119,7 @@
}
diff -ur thttpd-2.21b/libhttpd.c thttpd-2.21b-cool/libhttpd.c
--- thttpd-2.21b/libhttpd.cTue Apr 24 00:42:40 2001
-+++ thttpd-2.21b-cool/libhttpd.c Mon Jun 16 21:09:31 2003
thttpd-2.21b-cool/libhttpd.c Sat Sep 20 14:43:29 2003
@@ -56,6 +56,10 @@
#include unistd.h
#include stdarg.h
@@ -383,6 +383,15 @@
(void) my_snprintf( buf, sizeof(buf),
HTMLHEADTITLE%d %s/TITLE/HEAD\nBODY BGCOLOR=\#cc\H2%d
%s/H2\n,
status, title, status, title );
+@@ -764,7 +844,7 @@
+ char* cp2;
+
+ for ( cp1 = str, cp2 = dfstr;
+-*cp1 != '\0' cp2 - dfstr dfsize - 1;
++*cp1 != '\0' cp2 - dfstr dfsize - 5;
+ ++cp1, ++cp2 )
+ {
+ switch ( *cp1 )
@@ -834,7 +914,7 @@
fp = fopen( filename, r );
if ( fp == (FILE*) 0 )
@@ -964,7 +973,7 @@
str[0] = '?';
diff -ur thttpd-2.21b/libhttpd.h thttpd-2.21b-cool/libhttpd.h
--- thttpd-2.21b/libhttpd.hTue Apr 24 00:36:50 2001
-+++ thttpd-2.21b-cool/libhttpd.h Mon Jun 16 21:09:00 2003
thttpd-2.21b-cool/libhttpd.h Sat Sep 20 14:43:20 2003
@@ -69,6 +69,8 @@
char* server_hostname;
int port;
@@ -1026,7 +1035,7 @@
** mallocced strings.
diff -ur thttpd-2.21b/mime_encodings.txt thttpd-2.21b-cool/mime_encodings.txt
--- thttpd-2.21b/mime_encodings.txtWed May 10 03:22:28 2000
-+++ thttpd-2.21b-cool/mime_encodings.txt Mon Jun 16 21:08:05 2003
thttpd-2.21b-cool/mime_encodings.txt Sat Sep 20 14:43:20 2003
@@ -3,6 +3,6 @@
# A list of file extensions followed by the corresponding MIME encoding.
# Extensions not found in the table proceed to the mime_types table.
@@ -1038,7 +1047,7 @@
uux-uuencode
diff -ur thttpd-2.21b/mime_types.txt thttpd-2.21b-cool/mime_types.txt
--- thttpd-2.21b/mime_types.txtSat Apr 14 04:53:30 2001
-+++ thttpd-2.21b-cool/mime_types.txt Mon Jun 16 21:08:05 2003
thttpd-2.21b-cool/mime_types.txt Sat Sep 20 14:43:20 2003
@@ -1,135 +1,138 @@
-# mime_types.txt
-#
@@ -1289,7 +1298,7 @@
+ice x-conference/x-cooltalk
diff -ur thttpd-2.21b/mmc.c thttpd-2.21b-cool/mmc.c
--- thttpd-2.21b/mmc.c Fri Apr 13 23:02:15 2001
-+++ thttpd-2.21b-cool/mmc.cMon Jun 16 21:08:05 2003
thttpd-2.21b-cool/mmc.cSat Sep 20 14:43:20 2003
@@ -70,6 +70,9 @@
unsigned int hash;
int hash_idx;
@@ -1392,7 +1401,7 @@
else
diff -ur thttpd-2.21b/mmc.h thttpd-2.21b-cool/mmc.h
--- thttpd-2.21b/mmc.h Fri Apr 13 07:36:54 2001
-+++ thttpd-2.21b-cool/mmc.hMon Jun 16 21:08:05 2003
thttpd-2.21b-cool/mmc.hSat Sep 20 14:43:20 2003
@@ -31,8 +31,9 @@
/* Returns an mmap()ed area for the given file, or (void*) 0 on errors.
** If you have a stat buffer on the