From a7c135174cbc2c3113f8b1265bef32411dcbfcc9 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 3 Dec 2015 02:00:16 +0100 Subject: [PATCH] Fixes #1579 --- lib/core/common.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index 9558b69f9..77fc7bfa4 100755 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -3770,8 +3770,12 @@ def decodeHexValue(value, raw=False): def _(value): retVal = value - if value and isinstance(value, basestring) and len(value) % 2 == 0: - retVal = hexdecode(retVal) + if value and isinstance(value, basestring): + if len(value) % 2 != 0: + retVal = "%s?" % hexdecode(value[:-1]) + singleTimeWarnMessage("there was a problem decoding value '%s' from expected hexadecimal form" % value) + else: + retVal = hexdecode(value) if not kb.binaryField and not raw: if Backend.isDbms(DBMS.MSSQL) and value.startswith("0x"):