# HG changeset patch # User Mark Doliner # Date 1196625773 0 # Node ID 86f62b1e2a5a976cb2a32bf67ee5e078df70c148 # Parent 1a27ded7f9e3c250342fcb0493637b6d4694604b g_return_if_fail() if the chat room name or exchange aren't set or don't meet the requirements specified by the proto_chat_entry. It is the UI's responsibility to send the prpl valid chat room parameters. Fixes #4137. diff -r 1a27ded7f9e3 -r 86f62b1e2a5a libpurple/protocols/oscar/oscar.c --- a/libpurple/protocols/oscar/oscar.c Sun Dec 02 17:36:50 2007 +0000 +++ b/libpurple/protocols/oscar/oscar.c Sun Dec 02 20:02:53 2007 +0000 @@ -5352,26 +5352,29 @@ OscarData *od = (OscarData *)gc->proto_data; FlapConnection *conn; char *name, *exchange; + int exchange_int; name = g_hash_table_lookup(data, "room"); exchange = g_hash_table_lookup(data, "exchange"); - if ((name == NULL) || (*name == '\0')) { - purple_notify_error(gc, NULL, _("Invalid chat name specified."), NULL); - return; - } + g_return_if_fail(name != NULL && *name != '\0'); + g_return_if_fail(exchange != NULL); + + errno = 0; + exchange_int = strtol(exchange, NULL, 10); + g_return_if_fail(errno == 0); purple_debug_info("oscar", "Attempting to join chat room %s.\n", name); if ((conn = flap_connection_getbytype(od, SNAC_FAMILY_CHATNAV))) { purple_debug_info("oscar", "chatnav exists, creating room\n"); - aim_chatnav_createroom(od, conn, name, atoi(exchange)); + aim_chatnav_createroom(od, conn, name, exchange_int); } else { /* this gets tricky */ struct create_room *cr = g_new0(struct create_room, 1); purple_debug_info("oscar", "chatnav does not exist, opening chatnav\n"); - cr->exchange = atoi(exchange); + cr->exchange = exchange_int; cr->name = g_strdup(name); od->create_rooms = g_slist_prepend(od->create_rooms, cr); aim_srv_requestnew(od, SNAC_FAMILY_CHATNAV);