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