From: Sascha Schumann Date: Sun, 27 Aug 2000 09:32:23 +0000 (+0000) Subject: newtype has a length of newlen+1, 'len' refers to the length of *mimetype X-Git-Tag: php-4.0.2~45 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b2cecd9d8b84e65f544999fbb3bb3114e04d5eea;p=php newtype has a length of newlen+1, 'len' refers to the length of *mimetype here. --- diff --git a/main/SAPI.c b/main/SAPI.c index 60b886fd0a..95adcc9e68 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -247,8 +247,8 @@ SAPI_API size_t sapi_apply_default_charset(char **mimetype, size_t len SLS_DC) if (*charset && strncmp(*mimetype, "text/", 5) == 0 && strstr(*mimetype, "charset=") == NULL) { newlen = len + (sizeof(";charset=")-1) + strlen(charset); newtype = emalloc(newlen + 1); - strlcpy(newtype, *mimetype, len); - strlcat(newtype, ";charset=", len); + PHP_STRLCPY(newtype, *mimetype, newlen + 1, len); + strlcat(newtype, ";charset=", newlen + 1); if (*mimetype != NULL) { efree(*mimetype); }