From 7b9036cada59a0e5d9e10702230e9c3c8bec9bd5 Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Thu, 1 Aug 2002 07:49:53 +0000 Subject: [PATCH] Need room for the \0 here to avoid an overflow --- main/SAPI.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/SAPI.c b/main/SAPI.c index 3292a7c1c66..5e6bffc79c2 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -220,7 +220,7 @@ SAPI_API char *sapi_get_default_content_type(TSRMLS_D) 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 {