Skip to content

Commit 52ca521

Browse files
author
Hartmut Holzgraefe
committed
changed from strncpy to strlcpy on request
1 parent 60dcebd commit 52ca521

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

ext/yp/yp.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,7 @@ static int php_foreach_cat (int instatus, char *inkey, int inkeylen, char *inval
298298
if (inkeylen) {
299299
char *key = emalloc(inkeylen+1);
300300
if(key) {
301-
strncpy(key, inkey, inkeylen);
302-
key[inkeylen] = '\0';
301+
strlcpy(key, inkey, inkeylen+1);
303302
add_assoc_stringl_ex((zval *) indata, key, inkeylen+1, inval, invallen, 1);
304303
efree(key);
305304
} else {

0 commit comments

Comments
 (0)