# HG changeset patch # User Daniel Atallah # Date 1230849781 0 # Node ID c73a891d26a621d84fa5a3a0b5621313d3cd0b37 # Parent d6c2d6c9fd2a7a7e8f79f3a1e79f0ba77a9479d5 Fix a race condition that can result in a NULL ptr deref. Fixes #7920. diff -r d6c2d6c9fd2a -r c73a891d26a6 libpurple/protocols/bonjour/mdns_win32.c --- a/libpurple/protocols/bonjour/mdns_win32.c Thu Jan 01 19:29:30 2009 +0000 +++ b/libpurple/protocols/bonjour/mdns_win32.c Thu Jan 01 22:43:01 2009 +0000 @@ -167,7 +167,11 @@ ResolveCallbackArgs *args = (ResolveCallbackArgs*) data; Win32BuddyImplData *idata = args->bb->mdns_impl_data; gboolean delete_buddy = FALSE; - PurpleBuddy *pb; + PurpleBuddy *pb = NULL; + + /* Make sure that the BonjourBuddy associated with this request is still around */ + if (g_slist_find(pending_buddies, args->bb) == NULL) + goto cleanup; if ((pb = purple_find_buddy(args->account, args->bb->name))) if (pb->proto_data != args->bb) @@ -209,6 +213,8 @@ } + cleanup: + /* free the hosts list*/ while (hosts != NULL) { hosts = g_slist_remove(hosts, hosts->data);