diff options
| author | Rasmus Lerdorf <rasmus@php.net> | 2002-08-01 07:49:53 +0000 |
|---|---|---|
| committer | Rasmus Lerdorf <rasmus@php.net> | 2002-08-01 07:49:53 +0000 |
| commit | 7b9036cada59a0e5d9e10702230e9c3c8bec9bd5 (patch) | |
| tree | b57f6a8957997b2b6c2b380fa010aea19aaad032 /main/SAPI.c | |
| parent | 4f5bd6b7d44162f2429fb3c97a38b9bcd3a924fe (diff) | |
| download | php-git-7b9036cada59a0e5d9e10702230e9c3c8bec9bd5.tar.gz | |
Need room for the \0 here to avoid an overflow
Diffstat (limited to 'main/SAPI.c')
| -rw-r--r-- | main/SAPI.c | 2 |
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 { |
