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
This commit is contained in:
Frank Voorburg 2018-07-30 15:57:22 +00:00
parent 56cf1c696d
commit 14e2f87abd
1 changed files with 2 additions and 2 deletions

View File

@ -929,12 +929,12 @@ static bool XcpLoaderSendCmdUnlock(uint8_t const * key, uint8_t keyLen,
assert(xcpSettings.transport != NULL); assert(xcpSettings.transport != NULL);
assert(key != NULL); assert(key != NULL);
assert(keyLen > 0); assert(keyLen > 0);
assert(keyLen < (xcpMaxCto - 2)); assert(keyLen <= (xcpMaxCto - 2));
assert(protectedResources != NULL); assert(protectedResources != NULL);
/* Only continue with a valid transport layer and parameters. */ /* Only continue with a valid transport layer and parameters. */
if ( (xcpSettings.transport != NULL) && (key != NULL) && (keyLen > 0) && 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. */ /* Init the result value to okay and only set it to error when a problem occurred. */
result = true; result = true;