Fixed CID 576799.

This commit is contained in:
Martin Kinčl
2021-03-03 20:57:40 +01:00
parent 9ea66868d8
commit f2b832415e

View File

@@ -751,7 +751,14 @@ int wc_i2d_PKCS12(WC_PKCS12* pkcs12, byte** der, int* derSz)
outerSz += mac->saltSz;
/* MAC iterations */
outerSz += SetShortInt(ASNSHORT, &tmpIdx, mac->itt, MAX_SHORT_SZ);
ret = SetShortInt(ASNSHORT, &tmpIdx, mac->itt, MAX_SHORT_SZ);
if (ret >= 0) {
outerSz += ret;
ret = 0;
}
else {
return ret;
}
/* sequence of inner data */
outerSz += SetSequence(innerSz, seq);