Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Sep 23rd, 2011  |  syntax: None  |  size: 1.19 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. From 9dc78fd59cd41bf38a91518698f473f6b08205a3 Mon Sep 17 00:00:00 2001
  2. From: localuser <localuser@localhost>
  3. Date: Fri, 23 Sep 2011 13:46:06 +0200
  4. Subject: [PATCH] Do not send a NULL pointer to strcmp()
  5.  
  6. This commit should fix a crash caused (according to dump) by the second argument
  7. to strcmp() being a NULL pointer in the function go_back_for_real.
  8.  
  9. Cannot reproduce the bug, but the crash occurred when going backward in the
  10. history.
  11. ---
  12.  xxxterm.c |    4 +++-
  13.  1 files changed, 3 insertions(+), 1 deletions(-)
  14.  
  15. diff --git a/xxxterm.c b/xxxterm.c
  16. index e16c822..a34d55f 100644
  17. --- a/xxxterm.c
  18. +++ b/xxxterm.c
  19. @@ -4089,12 +4089,14 @@ go_back_for_real(struct tab *t)
  20.  {
  21.         int                     i;
  22.         WebKitWebHistoryItem    *item;
  23. +       const gchar             *uri;
  24.  
  25.         /* the back/forwars list is stupid so help selecting a different item */
  26.         for (i = 0, item = webkit_web_back_forward_list_get_current_item(t->bfl);
  27.             item != NULL;
  28.             i--, item = webkit_web_back_forward_list_get_nth_item(t->bfl, i)) {
  29. -               if (strcmp(webkit_web_history_item_get_uri(item), get_uri(t))) {
  30. +               uri = get_uri(t);
  31. +               if (uri && strcmp(webkit_web_history_item_get_uri(item), uri)) {
  32.                         webkit_web_view_go_to_back_forward_item(t->wv, item);
  33.                         break;
  34.                 }
  35. --
  36. 1.7.3.5