comparison src/protocols/oscar/peer.c @ 13664:4132d997ccec

[gaim-migrate @ 16066] Fix Coverity CID 45: Check to make sure a channel 2 ICBM actually contains an IP address TLV before attempting to use it. This avoids a crash when the server sends us an abnormal channel 2 ICBM. I'm not sure if that ever happens. Fix Coverity CID 204: Don't attempt to send data over a FLAP BOS connection that doesn't exist. This should never happen because the account should get disconnected first. Fix Coverity CID 205: Don't check that a variable 'od' which we know is valid is not equal to NULL in aim_search_address() in family_userlookup.c Fix Coverity CID 206: Don't check that the variable 'od' which we know is valid is not equal to NULL in aim_chat_join() in family_oservice.c Fix Coverity CID 207: I neglected to remove a "return;" line from aim_admin_setnick() in family_admin.c which caused setting your AIM screen name formatting to not work. Fix Coverity CID 208: Remove a duplicate call to gaim_connection_get_account() in peer_connection_propose() in peer.c. Fix Coverity CID 209: Remove the unused variable "username" from incomingim_chan2() in oscar.c. Fix Coverity CID 210: Remove the unused variable "account" from peer_connection_listen_cb() in peer.c. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 20 Apr 2006 04:45:06 +0000
parents 6c34fbb75bbd
children ee026e289bc4
comparison
equal deleted inserted replaced
13663:b76c6de0c3b5 13664:4132d997ccec
514 peer_connection_listen_cb(gpointer data, gint source, GaimInputCondition cond) 514 peer_connection_listen_cb(gpointer data, gint source, GaimInputCondition cond)
515 { 515 {
516 PeerConnection *conn; 516 PeerConnection *conn;
517 OscarData *od; 517 OscarData *od;
518 GaimConnection *gc; 518 GaimConnection *gc;
519 GaimAccount *account;
520 struct sockaddr addr; 519 struct sockaddr addr;
521 socklen_t addrlen = sizeof(addr); 520 socklen_t addrlen = sizeof(addr);
522 521
523 conn = data; 522 conn = data;
524 od = conn->od; 523 od = conn->od;
525 gc = od->gc; 524 gc = od->gc;
526 account = gaim_connection_get_account(gc);
527 525
528 gaim_debug_info("oscar", "Accepting connection on listener socket.\n"); 526 gaim_debug_info("oscar", "Accepting connection on listener socket.\n");
529 527
530 conn->fd = accept(conn->listenerfd, &addr, &addrlen); 528 conn->fd = accept(conn->listenerfd, &addr, &addrlen);
531 if (conn->fd == -1) 529 if (conn->fd == -1)
593 account = gaim_connection_get_account(gc); 591 account = gaim_connection_get_account(gc);
594 conn->listenerfd = listenerfd; 592 conn->listenerfd = listenerfd;
595 593
596 /* Send the "please connect to me!" ICBM */ 594 /* Send the "please connect to me!" ICBM */
597 bos_conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICBM); 595 bos_conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICBM);
596 if (bos_conn == NULL)
597 {
598 /* Not good */
599 peer_connection_trynext(conn);
600 return;
601 }
602
598 listener_ip = gaim_network_get_my_ip(bos_conn->fd); 603 listener_ip = gaim_network_get_my_ip(bos_conn->fd);
599 listener_port = gaim_network_get_port_from_fd(conn->listenerfd); 604 listener_port = gaim_network_get_port_from_fd(conn->listenerfd);
600 if (conn->type == OSCAR_CAPABILITY_DIRECTIM) 605 if (conn->type == OSCAR_CAPABILITY_DIRECTIM)
601 { 606 {
602 aim_im_sendch2_odc_requestdirect(od, 607 aim_im_sendch2_odc_requestdirect(od,
772 */ 777 */
773 void 778 void
774 peer_connection_propose(OscarData *od, OscarCapability type, const char *sn) 779 peer_connection_propose(OscarData *od, OscarCapability type, const char *sn)
775 { 780 {
776 PeerConnection *conn; 781 PeerConnection *conn;
777 GaimAccount *account;
778
779 account = gaim_connection_get_account(od->gc);
780 782
781 if (type == OSCAR_CAPABILITY_DIRECTIM) 783 if (type == OSCAR_CAPABILITY_DIRECTIM)
782 { 784 {
783 conn = peer_connection_find_by_type(od, sn, type); 785 conn = peer_connection_find_by_type(od, sn, type);
784 if (conn != NULL) 786 if (conn != NULL)
785 { 787 {
786 if (conn->ready) 788 if (conn->ready)
787 { 789 {
790 GaimAccount *account;
788 GaimConversation *conv; 791 GaimConversation *conv;
789 792
790 gaim_debug_info("oscar", "Already have a direct IM " 793 gaim_debug_info("oscar", "Already have a direct IM "
791 "session with %s.\n", sn); 794 "session with %s.\n", sn);
792 account = gaim_connection_get_account(od->gc); 795 account = gaim_connection_get_account(od->gc);