summaryrefslogtreecommitdiff
path: root/ext/curl
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2016-08-29 21:15:55 +0200
committerAnatol Belski <ab@php.net>2016-08-29 21:15:55 +0200
commitc560678c148207499ae6f88e9c856de8cebc7621 (patch)
treeb99fedb378e67e40f779550377b0a27e4926ed10 /ext/curl
parent22a825db85070ecb9b7e4e5d6499782500c5eb97 (diff)
parent2004585d03bcc67467b736b22d9a746e7b2f8aab (diff)
downloadphp-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.c5
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);