From: Ilia Alshanetsky Date: Wed, 24 Jan 2007 00:45:54 +0000 (+0000) Subject: strcat() -> strlcat() X-Git-Tag: RELEASE_1_2_3~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb6b99d7df5d82396b5d7e750f312b211752f7c8;p=php strcat() -> strlcat() --- diff --git a/ext/standard/head.c b/ext/standard/head.c index dc98c83121..370558f629 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -111,7 +111,7 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t if (expires > 0) { strcat(cookie, "; expires="); dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, expires, 0 TSRMLS_CC); - strcat(cookie, dt); + strlcat(cookie, dt, len + 100); efree(dt); } } @@ -121,18 +121,18 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t } if (path && path_len > 0) { - strcat(cookie, "; path="); - strcat(cookie, path); + strlcat(cookie, "; path=", len + 100); + strlcat(cookie, path, len + 100); } if (domain && domain_len > 0) { - strcat(cookie, "; domain="); - strcat(cookie, domain); + strlcat(cookie, "; domain=", len + 100); + strlcat(cookie, domain, len + 100); } if (secure) { - strcat(cookie, "; secure"); + strlcat(cookie, "; secure", len + 100); } if (httponly) { - strcat(cookie, "; httponly"); + strlcat(cookie, "; httponly", len + 100); } ctr.line = cookie;