forked from wolfSSL/wolfssl
Merge pull request #2248 from kaleb-himes/ZD-5141
Fix for potential leak on err: Thanks to Chris H. for the report
This commit is contained in:
@ -4156,8 +4156,10 @@ int wc_DsaKeyToDer(DsaKey* key, byte* output, word32 inLen)
|
|||||||
seqSz = SetSequence(verSz + intTotalLen, seq);
|
seqSz = SetSequence(verSz + intTotalLen, seq);
|
||||||
|
|
||||||
outLen = seqSz + verSz + intTotalLen;
|
outLen = seqSz + verSz + intTotalLen;
|
||||||
if (outLen > (int)inLen)
|
if (outLen > (int)inLen) {
|
||||||
|
FreeTmpDsas(tmps, key->heap);
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
|
}
|
||||||
|
|
||||||
/* write to output */
|
/* write to output */
|
||||||
XMEMCPY(output, seq, seqSz);
|
XMEMCPY(output, seq, seqSz);
|
||||||
|
Reference in New Issue
Block a user