[Pidgin] #7765: g_strdup_printf can be called on a null string in purple_srv_resolve

Pidgin trac at pidgin.im
Thu Dec 11 17:17:31 EST 2008


#7765: g_strdup_printf can be called on a null string in purple_srv_resolve
-------------------+--------------------------------------------------------
Reporter:  fqueze  |        Type:  patch    
  Status:  new     |   Component:  libpurple
 Version:  2.5.2   |    Keywords:           
-------------------+--------------------------------------------------------
 I had a crash report in purple_srv_resolve (on Windows) on the line:
 query = g_strdup_printf("_%s._%s.%s", protocol, transport, domain);

 Even if calling this function with NULL parameters is definitively a bug,
 I think it should not crash.

 The attached patch adds a null check on all the 3 parameters, and also
 checks that the strings aren't empty. I think these strings should never
 be empty and that it's better to return early with a debug error if they
 are.

-- 
Ticket URL: <http://developer.pidgin.im/ticket/7765>
Pidgin <http://pidgin.im>
Pidgin


More information about the Tracker mailing list