diff options
author | Remi Collet <remi@remirepo.net> | 2019-07-24 16:06:07 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2019-07-25 11:50:44 +0200 |
commit | 946a1e43149e95969caf721b2fbc1bbffc3c478c (patch) | |
tree | eef601de0a448cb9e347690c4ee40d51d265464f /ext/standard/crypt.c | |
parent | 1cbcf0f4f1e9a14b3fc76f6d3e53b567a9464fd4 (diff) | |
download | php-git-946a1e43149e95969caf721b2fbc1bbffc3c478c.tar.gz |
Fix build warnings
- switch from strncpy to memcpy for -Wstringop-truncation
Diffstat (limited to 'ext/standard/crypt.c')
-rw-r--r-- | ext/standard/crypt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c index d0b1e6a5a7..b727575fad 100644 --- a/ext/standard/crypt.c +++ b/ext/standard/crypt.c @@ -255,7 +255,7 @@ PHP_FUNCTION(crypt) /* The automatic salt generation covers standard DES, md5-crypt and Blowfish (simple) */ if (!*salt) { - strncpy(salt, "$1$", 3); + memcpy(salt, "$1$", 3); php_random_bytes_throw(&salt[3], 8); php_to64(&salt[3], 8); strncpy(&salt[11], "$", PHP_MAX_SALT_LEN - 11); |