When the BugCheck intercept dumps an exception record, make sure that
the number of parameters dumped is no more than the maximum possible
in the record.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Reported-by: Igor Druzhinin <igor.druzhinin@citrix.com>
---
Cc: Igor Druzhinin <igor.druzhinin@citrix.com>
#define XEN_API extern
#include <ntddk.h>
+#include <stdlib.h>
#include <xen.h>
#include <bugcodes.h>
{
__try {
while (Exception != NULL) {
+ ULONG NumberParameters;
ULONG Index;
LogPrintf(LOG_LEVEL_CRITICAL,
__MODULE__,
Exception->ExceptionAddress);
- for (Index = 0; Index < Exception->NumberParameters; Index++)
+ NumberParameters = __min(EXCEPTION_MAXIMUM_PARAMETERS,
+ Exception->NumberParameters);
+
+ for (Index = 0; Index < NumberParameters; Index++)
LogPrintf(LOG_LEVEL_CRITICAL,
"%s|BUGCHECK: - Parameter[%u] = %p\n", __MODULE__,
Index,