mirror of
https://github.com/php/php-src.git
synced 2026-04-26 09:28:21 +02:00
- strncpy returns the byte copied not error code or 0
This commit is contained in:
@@ -211,7 +211,7 @@ char * php_md5_crypt_r(const char *pw, const char *salt, char *out) {
|
||||
strcat_s(passwd, MD5_HASH_MAX_LEN, "$");
|
||||
#else
|
||||
/* VC6 version doesn't have strcat_s or strncpy_s */
|
||||
if (strncpy(passwd + MD5_MAGIC_LEN, sp, sl + 1) != 0) {
|
||||
if (strncpy(passwd + MD5_MAGIC_LEN, sp, sl + 1) < sl) {
|
||||
goto _destroyCtx1;
|
||||
}
|
||||
strcat(passwd, "$");
|
||||
|
||||
Reference in New Issue
Block a user