diff --git a/src/common/cvt.cpp b/src/common/cvt.cpp index 5c0938fe66..bc9eeaaf88 100644 --- a/src/common/cvt.cpp +++ b/src/common/cvt.cpp @@ -3536,7 +3536,7 @@ static void hex_to_value(const char*& string, const char* end, RetPtr* retValue) int nibble = ((end - string) & 1); char ch; - while ((DIGIT((ch = UPPER(*string)))) || ((ch >= 'A') && (ch <= 'F'))) + while ((string < end) && ((DIGIT((ch = UPPER(*string)))) || ((ch >= 'A') && (ch <= 'F')))) { // Now convert the character to a nibble SSHORT c;