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:
parent
d044b13ce4
commit
adcc0efda6
@ -134,12 +134,6 @@ static cell_t MatchRegex(IPluginContext *pCtx, const cell_t *params)
|
|||||||
char *str;
|
char *str;
|
||||||
pCtx->LocalToString(params[2], &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);
|
int e = x->Match(str, offset);
|
||||||
if (e == -1)
|
if (e == -1)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user