diff options
author | Anatol Belski <ab@php.net> | 2016-08-29 21:15:55 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2016-08-29 21:15:55 +0200 |
commit | c560678c148207499ae6f88e9c856de8cebc7621 (patch) | |
tree | b99fedb378e67e40f779550377b0a27e4926ed10 /ext/curl | |
parent | 22a825db85070ecb9b7e4e5d6499782500c5eb97 (diff) | |
parent | 2004585d03bcc67467b736b22d9a746e7b2f8aab (diff) | |
download | php-git-c560678c148207499ae6f88e9c856de8cebc7621.tar.gz |
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
ensure null termination
Diffstat (limited to 'ext/curl')
-rw-r--r-- | ext/curl/interface.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 08846808fc..0fe4dbf2e9 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -1901,8 +1901,9 @@ static void create_certinfo(struct curl_certinfo *ci, zval *listcode) int len; char s[64]; char *tmp; - strncpy(s, slist->data, 64); - tmp = memchr(s, ':', 64); + strncpy(s, slist->data, sizeof(s)); + s[sizeof(s)-1] = '\0'; + tmp = memchr(s, ':', sizeof(s)); if(tmp) { *tmp = '\0'; len = strlen(s); |