Avoid memset(NULL, _, 0)
This commit is contained in:
parent
0d948d4b7e
commit
1dae690ad7
@ -75,14 +75,17 @@ crypto_sign_ed25519_open(unsigned char *m, unsigned long long *mlen_p,
|
||||
}
|
||||
mlen = smlen - 64;
|
||||
if (crypto_sign_ed25519_verify_detached(sm, sm + 64, mlen, pk) != 0) {
|
||||
if (m != NULL) {
|
||||
memset(m, 0, mlen);
|
||||
}
|
||||
goto badsig;
|
||||
}
|
||||
if (mlen_p != NULL) {
|
||||
*mlen_p = mlen;
|
||||
}
|
||||
if (m != NULL) {
|
||||
memmove(m, sm + 64, mlen);
|
||||
|
||||
}
|
||||
return 0;
|
||||
|
||||
badsig:
|
||||
|
Loading…
Reference in New Issue
Block a user