Prevent NULL pointer de-reference.

As a follow up to r279090, if dp hasn't been defined, we
shouldn't attempt to do an optimization here.
This commit is contained in:
Pedro F. Giffuni 2015-02-21 15:02:27 +00:00
parent 4c25bba76f
commit cc3a001f1c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=279104

View File

@ -244,7 +244,7 @@ matcher(struct re_guts *g,
ZAPSTATE(&m->mbs);
/* Adjust start according to moffset, to speed things up */
if (g->moffset > -1)
if (dp != NULL && g->moffset > -1)
start = ((dp - g->moffset) < start) ? start : dp - g->moffset;
SP("mloop", m->st, *start);