diff --git a/pcreposix.c b/pcreposix.c index f024423..dcc13ef 100644 --- a/pcreposix.c +++ b/pcreposix.c @@ -364,6 +364,7 @@ start location rather than being passed as a PCRE "starting offset". */ if ((eflags & REG_STARTEND) != 0) { + if (pmatch == NULL) return REG_INVARG; so = pmatch[0].rm_so; eo = pmatch[0].rm_eo; }