Text   |  XML   |  ReML   |   Visible Warnings:

Useless Assignment  at packet-iax2.c:761

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

iax_lookup_call_from_dest

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-iax2.c)expand/collapse
Show more  
 693  static iax_call_data *iax_lookup_call_from_dest( guint src_circuit_id,
 694                                                   guint dst_circuit_id,
 695                                                   guint framenum,
 696                                                   gboolean *reversed_p)
 697  {
 698    circuit_t *dst_circuit;
 699    iax_call_data * iax_call;
 700    gboolean reversed = FALSE;
 701     
 702    dst_circuit = find_circuit( CT_IAX2,
 703                                dst_circuit_id,
 704                                framenum );
 705   
 706    if( !dst_circuit ) {
 707  #ifdef DEBUG_HASHING 
 708      g_debug( "++ destination circuit not found, must have missed NEW packet" );
 709  #endif
 710      if( reversed_p )
 711        *reversed_p = FALSE;
 712      return NULL;
 713    }
 714   
 715  #ifdef DEBUG_HASHING 
 716    g_debug( "++ found destination circuit" );
 717  #endif
 718         
 719    iax_call = (iax_call_data *)circuit_get_proto_data(dst_circuit,proto_iax2);
 720   
 721    /* there's no way we can create a CT_IAX2 circuit without adding
 722       iax call data to it; assert this */
 723    DISSECTOR_ASSERT(iax_call);
 724   
 725    if( is_forward_circuit(dst_circuit_id, iax_call )) {
 726  #ifdef DEBUG_HASHING 
 727      g_debug( "++ destination circuit matches forward_circuit_id of call, "
 728                 "therefore packet is reversed" );
 729  #endif
 730   
 731      reversed = TRUE;
 732   
 733      if( iax_call -> n_reverse_circuit_ids == 0 ) {
 734        /* we are going in the reverse direction, and this call 
 735           doesn't have a reverse circuit associated with it.
 736           create one now. */
 737  #ifdef DEBUG_HASHING 
 738        g_debug( "++ reverse_circuit_id of call is zero, need to create a "
 739                   "new reverse circuit for this call" );
 740  #endif
 741   
 742        iax2_new_circuit_for_call( src_circuit_id, framenum, iax_call, TRUE );
 743  #ifdef DEBUG_HASHING 
 744        g_debug( "++ done" );
 745  #endif
 746      } else if( !is_reverse_circuit(src_circuit_id, iax_call )) {
 747        g_warning( "IAX Packet %u from circuit ids %u->%u "
 748                   "conflicts with earlier call with circuit ids %u->%u",
 749                   framenum,
 750                   src_circuit_id,dst_circuit_id,
 751                   iax_call->forward_circuit_ids[0],
 752                   iax_call->reverse_circuit_ids[0]);
 753        return NULL;
 754      }
 755    } else if ( is_reverse_circuit(dst_circuit_id, iax_call)) {
 756  #ifdef DEBUG_HASHING 
 757      g_debug( "++ destination circuit matches reverse_circuit_id of call, "
 758                 "therefore packet is forward" );
 759  #endif
 760   
 761      reversed = FALSE;
 762      if( !is_forward_circuit(src_circuit_id, iax_call)) {
 763        g_warning( "IAX Packet %u from circuit ids %u->%u "
 764                   "conflicts with earlier call with circuit ids %u->%u",
 765                   framenum,
 766                   src_circuit_id,dst_circuit_id,
 767                   iax_call->forward_circuit_ids[0],
 768                   iax_call->reverse_circuit_ids[0]);
 769        if( reversed_p )
 770          *reversed_p = FALSE;
 771        return NULL;
 772      }
 773    } else {
 774      DISSECTOR_ASSERT_NOT_REACHED();
 775    }
 776   
 777    if( reversed_p )
 778      *reversed_p = reversed;
 779   
 780    return iax_call;
 781  }
Show more  




Change Warning 2658.30755 : Useless Assignment

Priority:
State:
Finding:
Owner:
Note: