Fix invalid read on empty string queries.

This commit is contained in:
Justin Maggard 2014-12-16 15:30:45 -08:00
parent 4efca3660f
commit cdb0048082

View File

@ -252,7 +252,7 @@ expr returns [ pANTLR3_STRING result, int valid ]
val[0] = '\%';
}
if (val[strlen((char *)val) - 1] == '*')
if (val[0] && val[1] && val[strlen((char *)val) - 1] == '*')
{
op = '\%';
val[strlen((char *)val) - 1] = '\%';