Merge pull request #6702 from bandi13/ZD16572

Check the return value
This commit is contained in:
JacobBarthelmeh 2023-08-15 14:57:26 -06:00 committed by GitHub
commit a71114b4cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31698,9 +31698,16 @@ int StoreECC_DSA_Sig(byte* out, word32* outLen, mp_int* r, mp_int* s)
}
if (ret == 0) {
/* Encode DSA signature into buffer. */
SetASN_Items(dsaSigASN, dataASN, dsaSigASN_Length, out);
/* Set the actual encoding size. */
*outLen = (word32)sz;
ret = SetASN_Items(dsaSigASN, dataASN, dsaSigASN_Length, out);
if (ret >= 0) {
if (ret == sz) {
/* Set the actual encoding size. */
*outLen = (word32)sz;
ret = 0;
} else {
ret = BAD_STATE_E;
}
}
}
return ret;