Skip to content

Commit

Permalink
fix #58 : access to invalid address by reg->dmin value
Browse files Browse the repository at this point in the history
  • Loading branch information
K.Kosako committed May 23, 2017
1 parent 690313a commit 9690d3a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/regexec.c
Expand Up @@ -3154,6 +3154,8 @@ forward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s,
}
else {
UChar *q = p + reg->dmin;

if (q >= end) return 0; /* fail */
while (p < q) p += enclen(reg->enc, p);
}
}
Expand Down

0 comments on commit 9690d3a

Please sign in to comment.