(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/tcap-persistentdata.c) |
| |
| 477 | | | static struct tcaphash_begincall_t * |
| 478 | | | find_tcaphash_begin(struct tcaphash_begin_info_key_t *p_tcaphash_begin_key, |
| 479 | | | packet_info *pinfo, gboolean isBegin) |
| 480 | | | { |
| 481 | | | struct tcaphash_begincall_t *p_tcaphash_begincall = NULL; |
| 482 | | | p_tcaphash_begincall = (struct tcaphash_begincall_t *)g_hash_table_lookup(tcaphash_begin, p_tcaphash_begin_key); |
| 483 | | | |
| 484 | | | if(p_tcaphash_begincall) { |
| 485 | | | do { |
| 486 | | | if ( p_tcaphash_begincall->context ) { |
| 487 | | | if ( ( isBegin && |
| 488 | | | pinfo->fd->num == p_tcaphash_begincall->context->first_frame ) |
| 489 | | | || |
| 490 | | | ( !isBegin && |
| 491 | | | pinfo->fd->num >= p_tcaphash_begincall->context->first_frame && |
| 492 | | | ( p_tcaphash_begincall->context->last_frame?pinfo->fd->num <= p_tcaphash_begincall->context->last_frame:1 ) |
| 493 | | | ) |
| 494 | | | ) { |
| 495 | | | |
| 496 | | | #ifdef DEBUG_TCAPSRT |
| 497 | | | dbg(10,"B%d ", p_tcaphash_begincall->context->session_id); |
| 498 | | | #endif |
| 499 | | | return p_tcaphash_begincall; |
| 500 | | | break; |
| 501 | | | } |
| 502 | | | #ifdef DEBUG_TCAPSRT |
| 503 | | | dbg(60,"[B%d] ", p_tcaphash_begincall->context->session_id); |
| 504 | | | #endif |
| 505 | | | } |
| 506 | | | |
| 507 | | | if(p_tcaphash_begincall->next_begincall == NULL) { |
| 508 | | | #ifdef DEBUG_TCAPSRT |
| 509 | | | dbg(23,"End of Blist "); |
| 510 | | | #endif |
| 511 | | | break; |
| 512 | | | } |
| 513 | | | p_tcaphash_begincall = p_tcaphash_begincall->next_begincall; |
| 514 | | | } while (p_tcaphash_begincall != NULL) ; |
Redundant Condition
p_tcaphash_begincall != (void *)0 always evaluates to true. 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 p_tcaphash_begincall != (void *)0 cannot be false.
- A crashing bug occurs on every path where p_tcaphash_begincall != (void *)0 could have evaluated to false. Look for a preceding Null Pointer Dereference or Division By Zero warning.
|
|
| 515 | | | } else { |
| 516 | | | #ifdef DEBUG_TCAPSRT |
| 517 | | | dbg(23,"Not in Bhash "); |
| 518 | | | #endif |
| 519 | | | } |
| 520 | | | return NULL; |
| 521 | | | } |
| |