Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at packet-mgcp.c:2012

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

dissect_mgcp_localconnectionoptions

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-mgcp.c)expand/collapse
Show more  
 1980  dissect_mgcp_localconnectionoptions(proto_tree *parent_tree, tvbuff_t *tvb, gint offset, gint param_type_len, gint param_val_len)
 1981  {
 1982          proto_tree *tree = parent_tree;
 1983          proto_item *item = NULL;
 1984   
 1985          gchar *tokenline = NULL;
 1986          gchar **tokens = NULL;
 1987          gchar **typval = NULL;
 1988          guint i = 0;
 1989          guint tokenlen = 0;
 1990          int hf_uint = -1;
 1991          int hf_string = -1;
 1992   
 1993          if (parent_tree)
 1994          {
 1995                  item = proto_tree_add_item(parent_tree, hf_mgcp_param_localconnoptions, tvb, offset, param_type_len+param_val_len, FALSE);
 1996                  tree = proto_item_add_subtree(item, ett_mgcp_param_localconnectionoptions);
 1997          }
 1998   
 1999          /* The L: line */
 2000          offset += param_type_len; /* skip the L: */
 2001          tokenline = tvb_get_ephemeral_string(tvb, offset, param_val_len);
 2002   
 2003          /* Split into type=value pairs separated by comma */
 2004          tokens = ep_strsplit(tokenline, ",", -1);
 2005          for (i = 0; tokens[i] != NULL; i++)
 2006          {
 2007                  hf_uint = -1;
 2008                  hf_string = -1;
 2009           
 2010                  tokenlen = (int)strlen(tokens[i]);
 2011[+]                 typval = ep_strsplit(tokens[i], ":", 2);
 2012                  if ((typval[0] != NULL) && (typval[1] != NULL))
 2013                  {
 2014                          if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "p"))
 2015                          {
 2016                                  hf_uint = hf_mgcp_param_localconnoptions_p;
 2017                          }
 2018                          else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "a"))
 2019                          {
 2020                                  hf_string = hf_mgcp_param_localconnoptions_a;
 2021                          }
 2022                          else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "s"))
 2023                          {
 2024                                  hf_string = hf_mgcp_param_localconnoptions_s;
 2025                          }
 2026                          else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "e"))
 2027                          {
 2028                                  hf_string = hf_mgcp_param_localconnoptions_e;
 2029                          }
 2030                          else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "sc-rtp"))
 2031                          {
 2032                                  hf_string = hf_mgcp_param_localconnoptions_scrtp;
 2033                          }
 2034                          else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "sc-rtcp"))
 2035                          {
 2036                                  hf_string = hf_mgcp_param_localconnoptions_scrtcp;
 2037                          }
 2038                          else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "b"))
 2039                          {
 2040                                  hf_string = hf_mgcp_param_localconnoptions_b;
 2041                          }
 2042                          else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "es-ccd"))
 2043                          {
 2044                                  hf_string = hf_mgcp_param_localconnoptions_esccd;
 2045                          }
 2046                          else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "es-cci"))
 2047                          {
 2048                                  hf_string = hf_mgcp_param_localconnoptions_escci;
 2049                          }
 2050                          else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "dq-gi"))
 2051                          {
 2052                                  hf_string = hf_mgcp_param_localconnoptions_dqgi;
 2053                          }
 2054                          else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "dq-rd"))
 2055                          {
 2056                                  hf_string = hf_mgcp_param_localconnoptions_dqrd;
 2057                          }
 2058                          else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "dq-ri"))
 2059                          {
 2060                                  hf_string = hf_mgcp_param_localconnoptions_dqri;
 2061                          }
 2062                          else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "dq-rr"))
 2063                          {
 2064                                  hf_string = hf_mgcp_param_localconnoptions_dqrr;
 2065                          }
 2066                          else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "k"))
 2067                          {
 2068                                  hf_string = hf_mgcp_param_localconnoptions_k;
 2069                          }
 2070                          else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "gc"))
 2071                          {
 2072                                  hf_uint = hf_mgcp_param_localconnoptions_gc;
 2073                          }
 2074                          else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "fmtp"))
 2075                          {
 2076                                  hf_string = hf_mgcp_param_localconnoptions_fmtp;
 2077                          }
 2078                          else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "nt"))
 2079                          {
 2080                                  hf_string = hf_mgcp_param_localconnoptions_nt;
 2081                          }
 2082                          else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "o-fmtp"))
 2083                          {
 2084                                  hf_string = hf_mgcp_param_localconnoptions_ofmtp;
 2085                          }
 2086                          else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "r"))
 2087                          {
 2088                                  hf_string = hf_mgcp_param_localconnoptions_r;
 2089                          }
 2090                          else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "t"))
 2091                          {
 2092                                  hf_string = hf_mgcp_param_localconnoptions_t;
 2093                          }
 2094                          else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "r-cnf"))
 2095                          {
 2096                                  hf_string = hf_mgcp_param_localconnoptions_rcnf;
 2097                          }
 2098                          else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "r-dir"))
 2099                          {
 2100                                  hf_string = hf_mgcp_param_localconnoptions_rdir;
 2101                          }
 2102                          else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "r-sh"))
 2103                          {
 2104                                  hf_string = hf_mgcp_param_localconnoptions_rsh;
 2105                          }
 2106                          else 
 2107                          {
 2108                                  hf_uint = -1;
 2109                                  hf_string = -1;
 2110                          }
 2111   
 2112                          /* Add item */
 2113                          if (tree)
 2114                          {
 2115                                  if (hf_uint != -1)
 2116                                  {
 2117                                          proto_tree_add_uint(tree, hf_uint, tvb, offset, tokenlen, atol(typval[1]));
 2118                                  }
 2119                                  else if (hf_string != -1)
 2120                                  {
 2121                                          proto_tree_add_string(tree, hf_string, tvb, offset, tokenlen, g_strstrip(typval[1]));
 2122                                  }
 2123                                  else 
 2124                                  {
 2125                                          proto_tree_add_text(tree, tvb, offset, tokenlen, "Unknown parameter: %s", tokens[i]);
 2126                                  }
 2127                          }
 2128                  }
 2129                  else if (tree)
 2130                  {
 2131                          proto_tree_add_text(tree, tvb, offset, tokenlen, "Malformed parameter: %s", tokens[i]);
 2132                  }
 2133                  offset += tokenlen + 1; /* 1 extra for the delimiter */
Show more  




Change Warning 2737.31957 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: