
Untitled
By: a guest on
Sep 23rd, 2011 | syntax:
None | size: 1.19 KB | hits: 16 | expires: Never
From 9dc78fd59cd41bf38a91518698f473f6b08205a3 Mon Sep 17 00:00:00 2001
From: localuser <localuser@localhost>
Date: Fri, 23 Sep 2011 13:46:06 +0200
Subject: [PATCH] Do not send a NULL pointer to strcmp()
This commit should fix a crash caused (according to dump) by the second argument
to strcmp() being a NULL pointer in the function go_back_for_real.
Cannot reproduce the bug, but the crash occurred when going backward in the
history.
---
xxxterm.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/xxxterm.c b/xxxterm.c
index e16c822..a34d55f 100644
--- a/xxxterm.c
+++ b/xxxterm.c
@@ -4089,12 +4089,14 @@ go_back_for_real(struct tab *t)
{
int i;
WebKitWebHistoryItem *item;
+ const gchar *uri;
/* the back/forwars list is stupid so help selecting a different item */
for (i = 0, item = webkit_web_back_forward_list_get_current_item(t->bfl);
item != NULL;
i--, item = webkit_web_back_forward_list_get_nth_item(t->bfl, i)) {
- if (strcmp(webkit_web_history_item_get_uri(item), get_uri(t))) {
+ uri = get_uri(t);
+ if (uri && strcmp(webkit_web_history_item_get_uri(item), uri)) {
webkit_web_view_go_to_back_forward_item(t->wv, item);
break;
}
--
1.7.3.5