Fix some case of pattern parsing errors
authorAbhishek Arya <inferno@chromium.org>
Sun, 22 Jan 2012 09:47:50 +0000 (17:47 +0800)
committerDaniel Veillard <veillard@redhat.com>
Sun, 22 Jan 2012 09:47:50 +0000 (17:47 +0800)
We could accidentally hit an off by one string array access
due to improper loop exit when parsing patterns

libxslt/pattern.c

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