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:
commit
c77b99a8a4
@ -4156,8 +4156,10 @@ int wc_DsaKeyToDer(DsaKey* key, byte* output, word32 inLen)
|
||||
seqSz = SetSequence(verSz + intTotalLen, seq);
|
||||
|
||||
outLen = seqSz + verSz + intTotalLen;
|
||||
if (outLen > (int)inLen)
|
||||
if (outLen > (int)inLen) {
|
||||
FreeTmpDsas(tmps, key->heap);
|
||||
return BAD_FUNC_ARG;
|
||||
}
|
||||
|
||||
/* write to output */
|
||||
XMEMCPY(output, seq, seqSz);
|
||||
|
Loading…
x
Reference in New Issue
Block a user