Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

correct fix for #440

  • Loading branch information...
commit 81a62f6433e84bfba38a8ae3a9e49926c060c621 1 parent cd5b683
@vershov vershov authored
Showing with 4 additions and 1 deletion.
  1. +1 −1  src/Document.cpp
  2. +3 −0  src/cx_pcre_exec.cpp
View
2  src/Document.cpp
@@ -1342,7 +1342,7 @@ search_result Document::RegExFind(const pcre* re, const pcre_extra* study, int s
// Copy match info from ovector to result struct
sr.error_code = rc;
if (rc >= 0) {
- wxASSERT(ovector[0] >= 0 && ovector[1] <= (int)GetLength());
+ wxASSERT(ovector[0] >= 0 && ovector[0] <= (int)GetLength());
wxASSERT(ovector[1] >= ovector[0] && ovector[1] <= (int)GetLength());
sr.start = ovector[0];
sr.end = ovector[1];
View
3  src/cx_pcre_exec.cpp
@@ -4467,6 +4467,9 @@ real_pcre internal_re;
const real_pcre *external_re = (const real_pcre *)argument_re;
const real_pcre *re = external_re;
+/* Bound check */
+if (length < start_offset) return PCRE_ERROR_NOMATCH;
+
/* Plausibility checks */
if ((options & ~PUBLIC_EXEC_OPTIONS) != 0) return PCRE_ERROR_BADOPTION;
Please sign in to comment.
Something went wrong with that request. Please try again.