summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam M. Brack <wbrack@src.gnome.org>2009-01-24 03:06:51 +0000
committerWilliam M. Brack <wbrack@src.gnome.org>2009-01-24 03:06:51 +0000
commitcc8f0964b23cf2d656a7d0209904175acd496ca6 (patch)
treea35a57a5b996be977322af8abbf16be3f669dc41
parenteac88d34bf9d93c433a0e56f9dce0ad68961deda (diff)
downloadlibxslt-cc8f0964b23cf2d656a7d0209904175acd496ca6.tar.gz
libxslt-cc8f0964b23cf2d656a7d0209904175acd496ca6.tar.bz2
libxslt-cc8f0964b23cf2d656a7d0209904175acd496ca6.zip
Fixed indexing error reported by Ron Burk on the mailing list.
* libexslt/strings.c: Fixed indexing error reported by Ron Burk on the mailing list. svn path=/trunk/; revision=1494
-rw-r--r--ChangeLog5
-rw-r--r--libexslt/strings.c9
2 files changed, 9 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 0bd1ce9e..da3afd1a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Jan 23 19:02:28 PST 2009 William Brack <wbrack@mmm.com.hk>
+
+ * libexslt/strings.c: Fixed indexing error reported by
+ Ron Burk on the mailing list.
+
Fri Nov 14 15:06:55 CET 2008 Daniel Veillard <veillard@redhat.com>
* python/Makefile.am libxslt/Makefile.am configure.in
diff --git a/libexslt/strings.c b/libexslt/strings.c
index e4eb3eab..192d0c4a 100644
--- a/libexslt/strings.c
+++ b/libexslt/strings.c
@@ -589,15 +589,14 @@ exsltStrReplaceFunction (xmlXPathParserContextPtr ctxt, int nargs) {
}
str = xmlXPathPopString(ctxt);
- ret = xmlStrdup(str);
+ ret = xmlStrdup(str);
- for (i = 0; i < searchSet->nodeNr; i++) {
-
- searchStr = xmlXPathCastNodeToString(searchSet->nodeTab[i]);
+ for (i = 0; i < searchSet->nodeNr; i++) {
+ searchStr = xmlXPathCastNodeToString(searchSet->nodeTab[i]);
if (replaceSet != NULL) {
replaceStr = NULL;
- if (i <= replaceSet->nodeNr) {
+ if (i < replaceSet->nodeNr) {
replaceStr = xmlXPathCastNodeToString(replaceSet->nodeTab[i]);
}