- Fix possible buffer overflow. Always better to use strlcpy() instead

of strncpy()
This commit is contained in:
Andi Gutmans 2001-05-02 22:22:16 +00:00
parent 5aec595716
commit 0ac0f656ae

View File

@ -444,7 +444,7 @@ static size_t _php_curl_passwd(void *ctx, char *prompt, char *buf, int buflen)
return -1;
}
strncpy(buf, Z_STRVAL_P(retval), Z_STRLEN_P(retval));
strlcpy(buf, Z_STRVAL_P(retval), buflen);
zval_ptr_dtor(&argv[0]);
zval_ptr_dtor(&argv[1]);