Text   |  XML   |  ReML   |   Visible Warnings:

Unused Value  at packet-q931.c:1926

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

dissect_q931_guint16_value

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-q931.c)expand/collapse
Show more  
 1872  dissect_q931_guint16_value(tvbuff_t *tvb, int offset, int len,
 1873      proto_tree *tree, const char *label)
 1874  {
 1875          guint8 octet;
 1876          guint16 value;
 1877          int value_len;
 1878   
 1879          value_len = 0;
 1880   
 1881          octet = tvb_get_guint8(tvb, offset);
 1882          if (octet & Q931_IE_VL_EXTENSION) {
 1883                  /*
 1884                   * Only one octet long - error.
 1885                   */
 1886                  goto bad_length;
 1887          }
 1888          value = (octet & 0x3) << 14;
 1889          offset += 1;
 1890          len -= 1;
 1891          value_len++;
 1892   
 1893          if (len == 0) {
 1894                  /*
 1895                   * We've reached the end of the information element - error.
 1896                   */
 1897                  goto past_end;
 1898          }
 1899          octet = tvb_get_guint8(tvb, offset);
 1900          if (octet & Q931_IE_VL_EXTENSION) {
 1901                  /*
 1902                   * Only two octets long - error.
 1903                   */
 1904                  goto bad_length;
 1905          }
 1906          value |= (octet & 0x7F) << 7;
 1907          offset += 1;
 1908          len -= 1;
 1909          value_len++;
 1910   
 1911          if (len == 0) {
 1912                  /*
 1913                   * We've reached the end of the information element - error.
 1914                   */
 1915                  goto past_end;
 1916          }
 1917          octet = tvb_get_guint8(tvb, offset);
 1918          if (!(octet & Q931_IE_VL_EXTENSION)) {
 1919                  /*
 1920                   * More than three octets long - error.
 1921                   */
 1922                  goto bad_length;
 1923          }
 1924          value |= (octet & 0x7F);
 1925          offset += 1;
 1926          len -= 1;
 1927          value_len++;
 1928   
 1929          proto_tree_add_text(tree, tvb, offset, value_len, "%s: %u ms", label,
 1930              value);
 1931          return value_len;
 1932   
 1933  past_end:
 1934          proto_tree_add_text(tree, tvb, offset, len,
 1935              "%s goes past end of information element", label);
 1936          return -1;
 1937   
 1938  bad_length:
 1939          proto_tree_add_text(tree, tvb, offset, len, "%s isn't 3 octets long",
 1940              label);
 1941          return -1;
 1942  }
Show more  




Change Warning 2893.31225 : Unused Value

Priority:
State:
Finding:
Owner:
Note: