diff options
author | pfg <pfg@FreeBSD.org> | 2015-02-21 15:02:27 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2015-02-21 15:02:27 +0000 |
commit | 9705f06cfe0559e4bbc5264a5c725302bb4f2eec (patch) | |
tree | c7b1ae341dc75cb0c146b08c5a39dbb11ec6a3a2 /lib/libc/regex | |
parent | 4683d8fc5dd7f9306cca760df64fe49cba140536 (diff) | |
download | FreeBSD-src-9705f06cfe0559e4bbc5264a5c725302bb4f2eec.zip FreeBSD-src-9705f06cfe0559e4bbc5264a5c725302bb4f2eec.tar.gz |
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.
Diffstat (limited to 'lib/libc/regex')
-rw-r--r-- | lib/libc/regex/engine.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/regex/engine.c b/lib/libc/regex/engine.c index 8fc67ce..436370d 100644 --- a/lib/libc/regex/engine.c +++ b/lib/libc/regex/engine.c @@ -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); |