Check remaining query length in SetSqlModeParser

SetSqlModeParser would read uninitialized memory if a query consisting of
only comments would be executed.
This commit is contained in:
Markus Mäkelä 2018-07-16 09:11:21 +03:00
parent 4fb4ed416b
commit f77bf24df9
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -156,7 +156,10 @@ public:
bypass_whitespace();
if (is_set(m_pI))
// Check that there's enough characters to contain a SET keyword
bool long_enough = m_pEnd - m_pI > 3 ;
if (long_enough && is_set(m_pI))
{
rv = parse(pSql_mode);
}