wolfcrypt/src/asn.c: fix null pointer deref in SetReqAttribSingle() (clang-analyzer-core.NonNullParamChecker).

This commit is contained in:
Daniel Pouzzner
2022-08-04 11:12:09 -05:00
parent 99dad91344
commit d7e33b3293

View File

@ -26227,8 +26227,10 @@ static int SetReqAttribSingle(byte* output, int* idx, char* attr, int attrSz,
if (strSz > 0) { if (strSz > 0) {
XMEMCPY(&output[*idx], str, strSz); XMEMCPY(&output[*idx], str, strSz);
*idx += strSz; *idx += strSz;
XMEMCPY(&output[*idx], attr, attrSz); if (attrSz > 0) {
*idx += attrSz; XMEMCPY(&output[*idx], attr, attrSz);
*idx += attrSz;
}
} }
} }
return totalSz; return totalSz;