2007-08-18 Michael Snyder <msnyder@access-company.com>
authorMichael Snyder <msnyder@vmware.com>
Sat, 18 Aug 2007 20:05:48 +0000 (20:05 +0000)
committerMichael Snyder <msnyder@vmware.com>
Sat, 18 Aug 2007 20:05:48 +0000 (20:05 +0000)
* event-loop.c (delete_async_signal_handler): Move pointer null
test to before pointer dereference.

gdb/ChangeLog
gdb/event-loop.c

index 9c3b1118a4726778b2e69c369484d51abe63beb2..4ae9c5f7a2b9c689ad85359701a05ba099adcf25 100644 (file)
@@ -1,5 +1,8 @@
 2007-08-18  Michael Snyder  <msnyder@svkmacdonelllnx>
 
+       * event-loop.c (delete_async_signal_handler): Move pointer null
+       test to before pointer dereference.
+
        * ui-out.c (append_header_to_list): Possible cut and paste error.
 
        * MAINTAINERS: white space tweak.
index e28de9a39d993828e8c7a0a5178d067272858891..c946ce48cc4f2ca3617df37c194a2b8e9bca9099 100644 (file)
@@ -950,7 +950,7 @@ delete_async_signal_handler (async_signal_handler ** async_handler_ptr)
   else
     {
       prev_ptr = sighandler_list.first_handler;
-      while (prev_ptr->next_handler != (*async_handler_ptr) && prev_ptr)
+      while (prev_ptr && prev_ptr->next_handler != (*async_handler_ptr))
        prev_ptr = prev_ptr->next_handler;
       prev_ptr->next_handler = (*async_handler_ptr)->next_handler;
       if (sighandler_list.last_handler == (*async_handler_ptr))