changeset 14494:b472596cd7b9 stable

Stop segfault when regular expression contains malformed lookbehind atom (bug #35961) * liboctave/regexp.cc (compile_internal): Change '<=' to '<' in while loop condition to stop running beyond length of pattern.
author Rik <octave@nomad.inbox5.com>
date Sat, 24 Mar 2012 21:35:37 -0700
parents 3959f3f81e33
children ecd4b048f98c
files liboctave/regexp.cc
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/regexp.cc
+++ b/liboctave/regexp.cc
@@ -148,7 +148,7 @@
           size_t tmp_pos1 = new_pos + 2;
           size_t tmp_pos2 = tmp_pos1;
 
-          while (tmp_pos1 <= pattern.length () && brackets > 0)
+          while (tmp_pos1 < pattern.length () && brackets > 0)
             {
               char ch = pattern.at (tmp_pos1);