memcpy(): pointers must be valid even if the size is 0
This commit is contained in:
parent
0248c38626
commit
50e11be472
@ -232,8 +232,9 @@ crypto_hash_sha256_update(crypto_hash_sha256_state *state,
|
|||||||
in += 64;
|
in += 64;
|
||||||
inlen -= 64;
|
inlen -= 64;
|
||||||
}
|
}
|
||||||
memcpy(state->buf, in, inlen); /* inlen < 64 */
|
if (inlen > 0) {
|
||||||
|
memcpy(state->buf, in, inlen); /* inlen < 64 */
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,8 +262,9 @@ crypto_hash_sha512_update(crypto_hash_sha512_state *state,
|
|||||||
src += 128;
|
src += 128;
|
||||||
inlen -= 128;
|
inlen -= 128;
|
||||||
}
|
}
|
||||||
memcpy(state->buf, src, inlen); /* inlen < 128 */
|
if (inlen > 0) {
|
||||||
|
memcpy(state->buf, src, inlen); /* inlen < 128 */
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user