Text   |  XML   |  ReML   |   Visible Warnings:

Unused Value  at packet-q933.c:1490

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

dissect_q933_guint16_value

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-q933.c)expand/collapse
Show more  
 1436  dissect_q933_guint16_value(tvbuff_t *tvb, int offset, int len,
 1437      proto_tree *tree, const char *label)
 1438  {
 1439          guint8 octet;
 1440          guint16 value;
 1441          int value_len;
 1442   
 1443          value_len = 0;
 1444   
 1445          octet = tvb_get_guint8(tvb, offset);
 1446          if (octet & Q933_IE_VL_EXTENSION) {
 1447                  /*
 1448                   * Only one octet long - error.
 1449                   */
 1450                  goto bad_length;
 1451          }
 1452          value = (octet & 0x3) << 14;
 1453          offset += 1;
 1454          len -= 1;
 1455          value_len++;
 1456   
 1457          if (len == 0) {
 1458                  /*
 1459                   * We've reached the end of the information element - error.
 1460                   */
 1461                  goto past_end;
 1462          }
 1463          octet = tvb_get_guint8(tvb, offset);
 1464          if (octet & Q933_IE_VL_EXTENSION) {
 1465                  /*
 1466                   * Only two octets long - error.
 1467                   */
 1468                  goto bad_length;
 1469          }
 1470          value |= (octet & 0x7F) << 7;
 1471          offset += 1;
 1472          len -= 1;
 1473          value_len++;
 1474   
 1475          if (len == 0) {
 1476                  /*
 1477                   * We've reached the end of the information element - error.
 1478                   */
 1479                  goto past_end;
 1480          }
 1481          octet = tvb_get_guint8(tvb, offset);
 1482          if (!(octet & Q933_IE_VL_EXTENSION)) {
 1483                  /*
 1484                   * More than three octets long - error.
 1485                   */
 1486                  goto bad_length;
 1487          }
 1488          value |= (octet & 0x7F);
 1489          offset += 1;
 1490          len -= 1;
 1491          value_len++;
 1492   
 1493          proto_tree_add_text(tree, tvb, offset, value_len, "%s: %u ms", label,
 1494              value);
 1495          return value_len;
 1496   
 1497  past_end:
 1498          proto_tree_add_text(tree, tvb, offset, len,
 1499              "%s goes past end of information element", label);
 1500          return -1;
 1501   
 1502  bad_length:
 1503          proto_tree_add_text(tree, tvb, offset, len, "%s isn't 3 octets long",
 1504              label);
 1505          return -1;
 1506  }
Show more  




Change Warning 2896.31288 : Unused Value

Priority:
State:
Finding:
Owner:
Note: