summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun McCance <shaunm@src.gnome.org>2005-08-24 22:12:22 +0000
committerShaun McCance <shaunm@src.gnome.org>2005-08-24 22:12:22 +0000
commit9261d2163ae833ed1d1285ed7ff5c08dae2d5783 (patch)
tree588299eac5f1da8ffc5152f95e8062b731f0b5dd
parent49b05d8a9d16e63b2a89c79e9d86cb456c800fbc (diff)
downloadyelp-9261d2163ae833ed1d1285ed7ff5c08dae2d5783.tar.gz
- Patch from Brent Smith to fix crasher, #310420
* src/yelp-xslt-pager.c: - Patch from Brent Smith to fix crasher, #310420
-rw-r--r--ChangeLog5
-rw-r--r--src/yelp-xslt-pager.c33
2 files changed, 23 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 4c721681..c0dd0d3e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-08-24 Shaun McCance <shaunm@gnome.org>
+
+ * src/yelp-xslt-pager.c:
+ - Patch from Brent Smith to fix crasher, #310420
+
2005-08-24 Vincent Untz <vuntz@gnome.org>
* configure.in:
diff --git a/src/yelp-xslt-pager.c b/src/yelp-xslt-pager.c
index 01eac790..f7498a23 100644
--- a/src/yelp-xslt-pager.c
+++ b/src/yelp-xslt-pager.c
@@ -422,23 +422,26 @@ xslt_yelp_document (xsltTransformContextPtr ctxt,
page->contents = page_buf;
cur = xmlDocGetRootElement (new_doc);
- for (cur = cur->children; cur; cur = cur->next) {
- if (!xmlStrcmp (cur->name, (xmlChar *) "head")) {
- for (cur = cur->children; cur; cur = cur->next) {
- if (!xmlStrcmp (cur->name, (xmlChar *) "link")) {
- xmlChar *rel = xmlGetProp (cur, "rel");
-
- if (!xmlStrcmp (rel, (xmlChar *) "previous"))
- page->prev_id = xmlGetProp (cur, "href");
- else if (!xmlStrcmp (rel, (xmlChar *) "next"))
- page->next_id = xmlGetProp (cur, "href");
- else if (!xmlStrcmp (rel, (xmlChar *) "top"))
- page->toc_id = xmlGetProp (cur, "href");
-
- xmlFree (rel);
+
+ if (cur != NULL) {
+ for (cur = cur->children; cur; cur = cur->next) {
+ if (!xmlStrcmp (cur->name, (xmlChar *) "head")) {
+ for (cur = cur->children; cur; cur = cur->next) {
+ if (!xmlStrcmp (cur->name, (xmlChar *) "link")) {
+ xmlChar *rel = xmlGetProp (cur, "rel");
+
+ if (!xmlStrcmp (rel, (xmlChar *) "previous"))
+ page->prev_id = xmlGetProp (cur, "href");
+ else if (!xmlStrcmp (rel, (xmlChar *) "next"))
+ page->next_id = xmlGetProp (cur, "href");
+ else if (!xmlStrcmp (rel, (xmlChar *) "top"))
+ page->toc_id = xmlGetProp (cur, "href");
+
+ xmlFree (rel);
+ }
}
+ break;
}
- break;
}
}