Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at packet-dcm.c:5129

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

dissect_dcm_tag_value

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-dcm.c)expand/collapse
Show more  
 5078  dissect_dcm_tag_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_state_pdv_t *pdv,
 5079                        guint32 offset, guint16 grp, guint16 elm,
 5080                        guint32 vl, guint32 vl_max, gchar* vr, gchar **tag_value)
 5081  {
 5082      /* Based on the value representation, decode the value of one tag. Returns new offset */
 5083   
 5084      proto_item *pitem = NULL;
 5085   
 5086      gboolean is_little_endian;
 5087   
 5088      if (pdv->syntax == DCM_EBE) is_little_endian = FALSE;
 5089      else                        is_little_endian = TRUE;
 5090   
 5091   
 5092      /* ---------------------------------------------------------------------------
 5093         Potentially long types. Obey vl_max
 5094         ---------------------------------------------------------------------------
 5095      */
 5096   
 5097      if ((strncmp(vr, "AE", 2) == 0) || (strncmp(vr, "AS", 2) == 0) || (strncmp(vr, "CS", 2) == 0) ||
 5098          (strncmp(vr, "DA", 2) == 0) || (strncmp(vr, "DS", 2) == 0) || (strncmp(vr, "DT", 2) == 0) ||
 5099          (strncmp(vr, "IS", 2) == 0) || (strncmp(vr, "LO", 2) == 0) || (strncmp(vr, "LT", 2) == 0) ||
 5100          (strncmp(vr, "PN", 2) == 0) || (strncmp(vr, "SH", 2) == 0) || (strncmp(vr, "ST", 2) == 0) ||
 5101          (strncmp(vr, "TM", 2) == 0) || (strncmp(vr, "UI", 2) == 0) || (strncmp(vr, "UT", 2) == 0) ) {
 5102          /* 15 ways to represent a string ... */
 5103   
 5104          gchar   *vals;
 5105          dcm_uid_t  *uid = NULL;
 5106          guint8  val8;
 5107   
 5108          val8 = tvb_get_guint8(tvb, offset + vl_max - 1);
 5109          if (val8 == 0x00) {
 5110              /* Last byte of string is 0x00, i.e. padded */
 5111[+]             vals = tvb_format_text(tvb, offset, vl_max - 1);
 5112          }
 5113          else {
 5114              vals = tvb_format_text(tvb, offset, vl_max);
 5115          }
 5116   
 5117          if ((strncmp(vr, "UI", 2) == 0) && vals != NULL) {
 5118              /* This is a UID. Attempt a lookup. Will only return something for classes of course */
 5119   
 5120              uid = g_hash_table_lookup(dcm_uid_table, (gpointer) vals);
 5121              if (uid) {
 5122                  g_snprintf(*tag_value, MAX_BUF_LEN, "%s (%s)", vals, uid->name);
 5123              }
 5124              else {
 5125                  g_snprintf(*tag_value, MAX_BUF_LEN, "%s", vals);
 5126              }
 5127          }
 5128          else {
 5129              if (strlen(vals) > 50) {
Show more  




Change Warning 2185.31457 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: