stas Sun Dec 7 08:01:09 2003 EDT
Modified files:
/php-src/sapi/cgi/libfcgi os_unix.c
Log:
fix potential buffer overrun
Index: php-src/sapi/cgi/libfcgi/os_unix.c
diff -u php-src/sapi/cgi/libfcgi/os_unix.c:1.3 php-src/sapi/cgi/libfcgi/os_unix.c:1.4
--- php-src/sapi/cgi/libfcgi/os_unix.c:1.3 Tue Nov 26 00:51:16 2002
+++ php-src/sapi/cgi/libfcgi/os_unix.c Sun Dec 7 07:59:54 2003
@@ -17,7 +17,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$Id: os_unix.c,v 1.3 2002/11/26 05:51:16 shane Exp $";
+static const char rcsid[] = "$Id: os_unix.c,v 1.4 2003/12/07 12:59:54 stas Exp $";
#endif /* not lint */
#include "fcgi_config.h"
@@ -103,6 +103,11 @@
static int shutdownPending = FALSE;
static int shutdownNow = FALSE;
+#ifndef HAVE_STRLCPY
+#define strlcpy php_strlcpy
+#endif
+size_t strlcpy(char *dst, const char *src, size_t siz);
+
void OS_ShutdownPending()
{
shutdownPending = TRUE;
@@ -293,7 +298,7 @@
short port = 0;
char host[MAXPATHLEN];
- strcpy(host, bindPath);
+ strlcpy(host, bindPath, MAXPATHLEN-1);
if((tp = strchr(host, ':')) != 0) {
*tp++ = 0;
if((port = atoi(tp)) == 0) {
@@ -396,7 +401,7 @@
short port = 0;
int tcp = FALSE;
- strcpy(host, bindPath);
+ strlcpy(host, bindPath, MAXPATHLEN-1);
if((tp = strchr(host, ':')) != 0) {
*tp++ = 0;
if((port = atoi(tp)) == 0) {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php