mirror of
https://github.com/php/php-src.git
synced 2024-11-28 04:14:26 +08:00
Need room for the \0 here to avoid an overflow
This commit is contained in:
parent
4f5bd6b7d4
commit
7b9036cada
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user