(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ipsec.c) |
| |
| 1467 | | | dissect_esp_authentication(proto_tree *tree, tvbuff_t *tvb, gint len, gint esp_auth_len, guint8 *authenticator_data_computed, |
| 1468 | | | gboolean authentication_ok, gboolean authentication_checking_ok) |
| 1469 | | | { |
| 1470 | | | if(esp_auth_len == 0) |
| 1471 | | | { |
| 1472 | | | proto_tree_add_text(tree, tvb, len, 0, |
| 1473 | | | "NULL Authentication"); |
| 1474 | | | } |
| 1475 | | | |
| 1476 | | | |
| 1477 | | | else if(tvb_bytes_exist(tvb, len - esp_auth_len, esp_auth_len)) |
| 1478 | | | { |
| 1479 | | | if((authentication_ok) && (authentication_checking_ok)) |
| 1480 | | | { |
| 1481 | | | proto_tree_add_text(tree, tvb, len - esp_auth_len, esp_auth_len, |
| 1482 | | | "Authentication Data [correct]"); |
| 1483 | | | } |
| 1484 | | | |
| 1485 | | | else if((authentication_ok) && (!authentication_checking_ok)) |
Redundant Condition
authentication_checking_ok always evaluates to false. This may be because: - There is a constant assignment to one or more of the variables involved.
- An earlier conditional statement has already ensured that authentication_checking_ok cannot be true.
- A crashing bug occurs on every path where authentication_checking_ok could have evaluated to true. Look for a preceding Null Pointer Dereference or Division By Zero warning.
|
|
| 1486 | | | { |
| 1487 | | | proto_tree_add_text(tree, tvb, len - esp_auth_len, esp_auth_len, |
| 1488 | | | "Authentication Data [incorrect, should be 0x%s]", authenticator_data_computed); |
| 1489 | | | |
| 1490 | | | g_free(authenticator_data_computed); |
| 1491 | | | } |
| 1492 | | | |
| 1493 | | | else proto_tree_add_text(tree, tvb, len - esp_auth_len, esp_auth_len, |
| 1494 | | | "Authentication Data"); |
| 1495 | | | } |
| 1496 | | | else |
| 1497 | | | { |
| 1498 | | | |
| 1499 | | | proto_tree_add_text(tree, tvb, len - esp_auth_len, esp_auth_len - (len - tvb_length(tvb)), |
| 1500 | | | "Authentication Data (truncated)"); |
| 1501 | | | } |
| 1502 | | | } |
| |