Fix insertstream value implicit insert detection

The pointer being at the end of the buffer was not checked.
This commit is contained in:
Markus Mäkelä
2017-02-02 12:58:30 +02:00
parent 3a447607a7
commit a2ffb0476f

View File

@ -540,12 +540,12 @@ static bool only_implicit_values(GWBUF *buffer)
/** Skip the closing parenthesis and any whitespace */
ptr++;
while (isspace(*ptr) && ptr < (char*)buffer->end)
while (ptr < (char*)buffer->end && isspace(*ptr))
{
ptr++;
}
if (!isalnum(*ptr) && ptr < (char*)buffer->end)
if (ptr >= (char*)buffer->end || !isalnum(*ptr))
{
/**
* The first pair of parentheses was followed by a non-alphanumeric