Text   |  XML   |  ReML   |   Visible Warnings:

Buffer Overrun  at value_string.c:61

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

dissect_PNIO_status

(/home/sate/Testcases/c/cve/wireshark-1.2.0/plugins/profinet/packet-dcerpc-pn-io.c)expand/collapse
Show more  
 1618  dissect_PNIO_status(tvbuff_t *tvb, int offset,
 1619          packet_info *pinfo, proto_tree *tree, guint8 *drep)
 1620  {
 1621      guint8  u8ErrorCode;
 1622      guint8  u8ErrorDecode;
 1623      guint8  u8ErrorCode1;
 1624      guint8  u8ErrorCode2;
 1625   
 1626      proto_item *sub_item;
 1627          proto_tree *sub_tree;
 1628          guint32 u32SubStart;
 1629      int bytemask = (drep[0] & 0x10) ? 3 : 0;
 1630      const value_string *error_code1_vals;
 1631      const value_string *error_code2_vals = pn_io_error_code2;   /* defaults */
 1632   
 1633   
 1634   
 1635      /* status */
 1636      sub_item = proto_tree_add_item(tree, hf_pn_io_status, tvb, offset, 0, FALSE);
 1637          sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_status);
 1638      u32SubStart = offset;
 1639   
 1640      /* the PNIOStatus field is existing in both the RPC and the application data,
 1641       * depending on the current PDU.
 1642       * As the byte representation of these layers are different, this has to be handled 
 1643       * in a somewhat different way than elsewhere. */
 1644   
 1645      dissect_dcerpc_uint8(tvb, offset+(0^bytemask), pinfo, sub_tree, drep,
 1646[+]                         hf_pn_io_error_code, &u8ErrorCode);
 1647      dissect_dcerpc_uint8(tvb, offset+(1^bytemask), pinfo, sub_tree, drep,
 1648                          hf_pn_io_error_decode, &u8ErrorDecode);
 1649   
 1650      switch(u8ErrorDecode) {
 1651      case(0x80): /* PNIORW */
 1652          dissect_dcerpc_uint8(tvb, offset+(2^bytemask), pinfo, sub_tree, drep,
 1653                              hf_pn_io_error_code1_pniorw, &u8ErrorCode1);
 1654          error_code1_vals = pn_io_error_code1_pniorw;
 1655   
 1656          /* u8ErrorCode2 for PNIORW is always user specific */
 1657          dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
 1658                          hf_pn_io_error_code2_pniorw, &u8ErrorCode2);
 1659   
 1660           error_code2_vals = pn_io_error_code2_pniorw;
 1661   
 1662          break;
 1663      case(0x81): /* PNIO */
 1664          dissect_dcerpc_uint8(tvb, offset+(2^bytemask), pinfo, sub_tree, drep,
 1665                              hf_pn_io_error_code1_pnio, &u8ErrorCode1);
 1666          error_code1_vals = pn_io_error_code1_pnio;
 1667   
 1668          switch(u8ErrorCode1) {
 1669          case(22):
 1670              dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
 1671                              hf_pn_io_error_code2_pnio_22, &u8ErrorCode2);
 1672              error_code2_vals = pn_io_error_code2_pnio_22;
 1673
1700
Show [ Lines 1673 to 1700 omitted. ]
 1701   
 1702          /* don't know this u8ErrorDecode, use defaults */
 1703          dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
 1704                          hf_pn_io_error_code2, &u8ErrorCode2);
 1705          if(u8ErrorDecode != 0) {
 1706              expert_add_info_format(pinfo, sub_item, PI_UNDECODED, PI_WARN,
 1707                          "Unknown ErrorDecode 0x%x", u8ErrorDecode);
 1708          }
 1709      }
 1710   
 1711      offset +=4;
 1712   
 1713      if(u8ErrorCode == 0 && u8ErrorDecode == 0 && u8ErrorCode1 == 0 && u8ErrorCode2 == 0) {
 1714          proto_item_append_text(sub_item, ": OK");
 1715          if (check_col(pinfo->cinfo, COL_INFO))
 1716                  col_append_str(pinfo->cinfo, COL_INFO, ", OK");
 1717      } else {
 1718          proto_item_append_text(sub_item, ": Error: \"%s\", \"%s\", \"%s\", \"%s\"",
 1719              val_to_str(u8ErrorCode, pn_io_error_code, "(0x%x)"),
 1720              val_to_str(u8ErrorDecode, pn_io_error_decode, "(0x%x)"),
 1721              val_to_str(u8ErrorCode1, error_code1_vals, "(0x%x)"),
 1722[+]             val_to_str(u8ErrorCode2, error_code2_vals, "(0x%x)"));
expand/collapse

val_to_str

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/value_string.c)expand/collapse
Show more  
 39  const gchar*
 40  val_to_str(guint32 val, const value_string *vs, const char *fmt) {
 41    const gchar *ret;
 42   
 43    g_assert(fmt != NULL);
 44   
 45[+]   ret = match_strval(val, vs);
expand/collapse

match_strval

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/value_string.c)expand/collapse
Show more  
 75  const gchar*
 76  match_strval(guint32 val, const value_string *vs) {
 77      gint ignore_me;
 78[+]     return match_strval_idx(val, vs, &ignore_me);
expand/collapse

match_strval_idx

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/value_string.c)expand/collapse
Show more  
 56  const gchar*
 57  match_strval_idx(guint32 val, const value_string *vs, gint *idx) {
 58    gint i = 0;
 59   
 60    if(vs) {
 61      while (vs[i].strptr) {
 62        if (vs[i].value == val) {
 63          *idx = i;
 64          return(vs[i].strptr);
 65        }
 66        i++;
Show more  
Show more  
Show more  
Show more  




Change Warning 3753.32745 : Buffer Overrun

Priority:
State:
Finding:
Owner:
Note: