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 GitHub
parent d044b13ce4
commit adcc0efda6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -134,12 +134,6 @@ static cell_t MatchRegex(IPluginContext *pCtx, const cell_t *params)
char *str;
pCtx->LocalToString(params[2], &str);
size_t len = strlen(str);
if (offset >= len)
{
return pCtx->ThrowNativeError("Offset greater or equal than string length\n");
}
int e = x->Match(str, offset);
if (e == -1)
{