Fix matching Regex against an empty string (#1253)

Removed the offset check from MatchRegex, as this
is already handled by pcre_exec.
This commit is contained in:
Erik Minekus 2020-04-29 02:37:45 +02:00 committed by Asher Baker
parent 2e4fc2de54
commit c6fc4818ae

View File

@ -138,9 +138,6 @@ static cell_t MatchRegex(IPluginContext *pCtx, const cell_t *params)
char *str;
pCtx->LocalToString(params[2], &str);
if(offset >= strlen(str))
return pCtx->ThrowNativeError("Invalid string index\n");
int e = x->Match(str, offset);
if (e == -1)