]> granicus.if.org Git - php/commitdiff
strcat() -> strlcat()
authorIlia Alshanetsky <iliaa@php.net>
Wed, 24 Jan 2007 00:45:54 +0000 (00:45 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 24 Jan 2007 00:45:54 +0000 (00:45 +0000)
ext/standard/head.c

index dc98c831213658b0f1d234130eb560376e6df72d..370558f6296612868af4f43ca5b8d55f175d5831 100644 (file)
@@ -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;