Constrain number of dimms and sockets with global limits
Avoid unnecessary cycles in VerifyTargetDimms if number of dimms
and/or sockets is greater than the limit.
@@ -1348,7 +1348,8 @@ VerifyTargetDimms (
NVDIMM_ENTRY();
- if (pDimms == NULL || pDimmsNum == NULL || pCommandStatus == NULL) {
+ if (pDimms == NULL || pDimmsNum == NULL || pCommandStatus == NULL ||
+ DimmIdsCount > MAX_DIMMS || SocketIdsCount > MAX_SOCKETS) {
ReturnCode = EFI_INVALID_PARAMETER;
goto Finish;
}
