From 625482dcdd688996620bf997373e08b8fd5b827a Mon Sep 17 00:00:00 2001 From: Jason Watkins Date: Fri, 24 Apr 2015 09:39:15 -0700 Subject: [PATCH] Fixed bug in DATA message handler. - Data validation checks were being executed in the wrong order. This caused most valid DATA commands to be reported as empty. --- xpcPlugin/MessageHandlers.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/xpcPlugin/MessageHandlers.cpp b/xpcPlugin/MessageHandlers.cpp index 90f0aa8..4f3f7a1 100644 --- a/xpcPlugin/MessageHandlers.cpp +++ b/xpcPlugin/MessageHandlers.cpp @@ -228,13 +228,6 @@ namespace XPC Log::FormatLine("[DATA] Message Received (Conn %i)", connection.id); #endif } - if (numCols > 32) // Error. Will overflow values - { -#if LOG_VERBOSITY > 0 - Log::FormatLine("[DATA] ERROR numCols to large."); -#endif - return; - } else { #if LOG_VERBOSITY > 1 @@ -242,7 +235,15 @@ namespace XPC #endif return; } - float values[32][9]; + + if (numCols > 134) // Error. Will overflow values + { +#if LOG_VERBOSITY > 0 + Log::FormatLine("[DATA] ERROR numCols to large."); +#endif + return; + } + float values[134][9]; for (int i = 0; i < numCols; ++i) { values[i][0] = buffer[5 + 36 * i];