Added error message for multi-statements to dbfwfilter.

This commit is contained in:
Markus Makela
2015-04-02 16:47:19 +03:00
parent 795a683c55
commit fa7e0ea7c0
2 changed files with 18 additions and 3 deletions

View File

@ -830,10 +830,16 @@ int modutil_count_statements(GWBUF* buffer)
char* end = ((char*)(buffer)->end);
int num = 1;
while((ptr = strnchr_esc(ptr,';', end - ptr)))
while(ptr < end && (ptr = strnchr_esc(ptr,';', end - ptr)))
{
num++;
ptr++;
while(*ptr == ';')
ptr++;
}
if(*(end - 1) == ';')
{
num--;
}
return num;