summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/SAPI.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/SAPI.c b/main/SAPI.c
index 3292a7c1c6..5e6bffc79c 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 {