From 287b5475293af40f2e2f4768cdff34a8066e800d Mon Sep 17 00:00:00 2001 From: Jan Vorlicek Date: Sat, 21 Feb 2015 00:28:15 +0100 Subject: [PATCH] Remove duplicate check for number of exception arguments I have added a check for the exception arguments in my last commit, but it turns out there was already one, only in a wrong place. So the exceptionRecord.NumberParameters was set incorrectly to the unclipped value. --- src/pal/src/exception/seh-unwind.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/pal/src/exception/seh-unwind.cpp b/src/pal/src/exception/seh-unwind.cpp index 873f62b..919c000 100644 --- a/src/pal/src/exception/seh-unwind.cpp +++ b/src/pal/src/exception/seh-unwind.cpp @@ -223,8 +223,11 @@ RaiseException(IN DWORD dwExceptionCode, dwExceptionCode ^= RESERVED_SEH_BIT; } - if (nNumberOfArguments > EXCEPTION_MAXIMUM_PARAMETERS) + if (nNumberOfArguments > EXCEPTION_MAXIMUM_PARAMETERS) { + WARN("Number of arguments (%d) exceeds the limit " + "EXCEPTION_MAXIMUM_PARAMETERS (%d); ignoring extra parameters.\n", + nNumberOfArguments, EXCEPTION_MAXIMUM_PARAMETERS); nNumberOfArguments = EXCEPTION_MAXIMUM_PARAMETERS; } @@ -238,13 +241,6 @@ RaiseException(IN DWORD dwExceptionCode, exceptionRecord.NumberParameters = nNumberOfArguments; if (nNumberOfArguments) { - if (nNumberOfArguments > EXCEPTION_MAXIMUM_PARAMETERS) - { - WARN("Number of arguments (%d) exceeds the limit " - "EXCEPTION_MAXIMUM_PARAMETERS (%d); ignoring extra parameters.\n", - nNumberOfArguments, EXCEPTION_MAXIMUM_PARAMETERS); - nNumberOfArguments = EXCEPTION_MAXIMUM_PARAMETERS; - } CopyMemory(exceptionRecord.ExceptionInformation, lpArguments, nNumberOfArguments * sizeof(ULONG_PTR)); } -- 2.7.4