cvs: php4 /main SAPI.c
| From: | Rasmus Lerdorf | Date: | Thu, 01 Aug 2002 07:49:54 +0000 |
| Subject: | cvs: php4 /main SAPI.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-13073@lists.php.net to get a copy of this message | ||
rasmus Thu Aug 1 03:49:54 2002 EDT
Modified files:
/php4/main SAPI.c
Log:
Need room for the \0 here to avoid an overflow
Index: php4/main/SAPI.c
diff -u php4/main/SAPI.c:1.139 php4/main/SAPI.c:1.140
--- php4/main/SAPI.c:1.139 Wed Jul 31 13:55:15 2002
+++ php4/main/SAPI.c Thu Aug 1 03:49:53 2002
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: SAPI.c,v 1.139 2002/07/31 17:55:15 helly Exp $ */
+/* $Id: SAPI.c,v 1.140 2002/08/01 07:49:53 rasmus Exp $ */
#include <ctype.h>
#include <sys/stat.h>
@@ -220,7 +220,7 @@
charset = SG(default_charset) ? SG(default_charset) : SAPI_DEFAULT_CHARSET;
if (strncasecmp(mimetype, "text/", 5) == 0 && *charset) {
- int len = strlen(mimetype) + sizeof("; charset=") + strlen(charset);
+ int len = strlen(mimetype) + sizeof("; charset=") + strlen(charset)+1;
content_type = emalloc(len);
snprintf(content_type, len, "%s; charset=%s", mimetype, charset);
} else {