Fix some case of pattern parsing errors
authorAbhishek Arya <inferno@chromium.org>
Sun, 22 Jan 2012 09:47:50 +0000 (17:47 +0800)
committerAron Xu <aronxu@gnome.org>
Thu, 5 Jul 2012 03:26:40 +0000 (11:26 +0800)
We could accidentally hit an off by one string array access
due to improper loop exit when parsing patterns

libxslt/pattern.c

index 8ce74e3..e0aebff 100644 (file)
@@ -1864,6 +1864,8 @@ xsltCompilePatternInternal(const xmlChar *pattern, xmlDocPtr doc,
                while ((pattern[end] != 0) && (pattern[end] != '"'))
                    end++;
            }
+           if (pattern[end] == 0)
+               break;
            end++;
        }
        if (current == end) {