Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at packet-tcp.c:2424

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

dissect_tcpopt_scps

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-tcp.c)expand/collapse
Show more  
 2320  dissect_tcpopt_scps(const ip_tcp_opt *optp, tvbuff_t *tvb,
 2321                      int offset, guint optlen, packet_info *pinfo,
 2322                      proto_tree *opt_tree)
 2323  {
 2324    struct tcp_analysis *tcpd=NULL;
 2325    proto_tree *field_tree = NULL;
 2326    tcp_flow_t *flow;
 2327    int         direction;
 2328    proto_item *tf = NULL, *hidden_item;
 2329    gchar       flags[64] = "<None>";
 2330    gchar      *fstr[] = {"BETS", "SNACK1", "SNACK2", "COMP", "NLTS", "RESV1", "RESV2", "RESV3"};
 2331    gint        i, bpos;
 2332    guint8      capvector;
 2333    guint8      connid;
 2334   
 2335[+]   tcpd = get_tcp_conversation_data(NULL,pinfo);
 2336   
 2337    /* check direction and get ua lists */
 2338    direction=CMP_ADDRESS(&pinfo->src, &pinfo->dst);
 2339   
 2340    /* if the addresses are equal, match the ports instead */
 2341    if(direction==0) {
 2342      direction= (pinfo->srcport > pinfo->destport) ? 1 : -1;
 2343    }
 2344   
 2345    if(direction>=0)
 2346      flow =&(tcpd->flow1);
 2347    else 
 2348      flow =&(tcpd->flow2);
 2349   
 2350    /* If the option length == 4, this is a real SCPS capability option 
 2351     * See "CCSDS 714.0-B-2 (CCSDS Recommended Standard for SCPS Transport Protocol
 2352     * (SCPS-TP)" Section 3.2.3 for definition.
 2353     */
 2354    if (optlen == 4) {
 2355      capvector = tvb_get_guint8(tvb, offset + 2);
 2356      flags[0] = '\0';
 2357   
 2358      /* Decode the capabilities vector for display */
 2359      for (i = 0; i < 5; i++) {
 2360        bpos = 128 >> i;
 2361        if (capvector & bpos) {
 2362                  if (flags[0]) {
 2363                    g_strlcat(flags, ", ", 64);
 2364                  }
 2365
2400
Show [ Lines 2365 to 2400 omitted. ]
 2401      proto_tree_add_boolean(field_tree, hf_tcp_scpsoption_flags_resv3, tvb,
 2402                             offset + 13, 1, capvector);
 2403   
 2404      tcp_info_append_str(pinfo, "SCPS", flags);
 2405   
 2406      flow->scps_capable = 1;
 2407   
 2408      if (connid)
 2409        tcp_info_append_uint(pinfo, "Connection ID", connid);
 2410    }
 2411    else {
 2412      /* The option length != 4, so this is an infamous "extended capabilities 
 2413       * option. See "CCSDS 714.0-B-2 (CCSDS Recommended Standard for SCPS
 2414       * Transport Protocol (SCPS-TP)" Section 3.2.5 for definition.
 2415       *
 2416       *  As the format of this option is only partially defined (it is 
 2417       * a community (or more likely vendor) defined format beyond that, so 
 2418       * at least for now, we only parse the standardized portion of the option.
 2419       */
 2420      guint8 local_offset = 2;
 2421      guint8 binding_space;
 2422      guint8 extended_cap_length;
 2423   
 2424      if (flow->scps_capable != 1) {
Show more  




Change Warning 3010.31427 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: