From 14e2f87abdb3b1c2403a881cab7df4757e37eab7 Mon Sep 17 00:00:00 2001 From: Frank Voorburg Date: Mon, 30 Jul 2018 15:57:22 +0000 Subject: [PATCH] Refs #606. Corrected key length assertion and validation in XcpLoaderSendCmdUnlock(). git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@561 5dc33758-31d5-4daf-9ae8-b24bf3d40d73 --- Host/Source/LibOpenBLT/xcploader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Host/Source/LibOpenBLT/xcploader.c b/Host/Source/LibOpenBLT/xcploader.c index a35ed98e..027951d4 100644 --- a/Host/Source/LibOpenBLT/xcploader.c +++ b/Host/Source/LibOpenBLT/xcploader.c @@ -929,12 +929,12 @@ static bool XcpLoaderSendCmdUnlock(uint8_t const * key, uint8_t keyLen, assert(xcpSettings.transport != NULL); assert(key != NULL); assert(keyLen > 0); - assert(keyLen < (xcpMaxCto - 2)); + assert(keyLen <= (xcpMaxCto - 2)); assert(protectedResources != NULL); /* Only continue with a valid transport layer and parameters. */ if ( (xcpSettings.transport != NULL) && (key != NULL) && (keyLen > 0) && - (keyLen < (xcpMaxCto - 2)) && (protectedResources != NULL) ) /*lint !e774 */ + (keyLen <= (xcpMaxCto - 2)) && (protectedResources != NULL) ) /*lint !e774 */ { /* Init the result value to okay and only set it to error when a problem occurred. */ result = true;