(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/tcap-persistentdata.c) |
| |
| 525 | | | static struct tcaphash_contcall_t * |
| 526 | | | find_tcaphash_cont(struct tcaphash_cont_info_key_t *p_tcaphash_cont_key, |
| 527 | | | packet_info *pinfo) |
| 528 | | | { |
| 529 | | | struct tcaphash_contcall_t *p_tcaphash_contcall = NULL; |
| 530 | | | p_tcaphash_contcall = (struct tcaphash_contcall_t *)g_hash_table_lookup(tcaphash_cont, p_tcaphash_cont_key); |
| 531 | | | |
| 532 | | | if(p_tcaphash_contcall) { |
| 533 | | | do { |
| 534 | | | if ( p_tcaphash_contcall->context ) { |
| 535 | | | if (pinfo->fd->num >= p_tcaphash_contcall->context->first_frame && |
| 536 | | | (p_tcaphash_contcall->context->last_frame?pinfo->fd->num <= p_tcaphash_contcall->context->last_frame:1) ) { |
| 537 | | | |
| 538 | | | #ifdef DEBUG_TCAPSRT |
| 539 | | | dbg(10,"C%d ", p_tcaphash_contcall->context->session_id); |
| 540 | | | #endif |
| 541 | | | return p_tcaphash_contcall; |
| 542 | | | break; |
| 543 | | | } |
| 544 | | | #ifdef DEBUG_TCAPSRT |
| 545 | | | dbg(60,"[C%d] ", p_tcaphash_contcall->context->session_id); |
| 546 | | | #endif |
| 547 | | | } |
| 548 | | | |
| 549 | | | if(p_tcaphash_contcall->next_contcall == NULL) { |
| 550 | | | #ifdef DEBUG_TCAPSRT |
| 551 | | | dbg(23,"End of Clist "); |
| 552 | | | #endif |
| 553 | | | break; |
| 554 | | | } |
| 555 | | | p_tcaphash_contcall = p_tcaphash_contcall->next_contcall; |
| 556 | | | } while (p_tcaphash_contcall != NULL) ; |
Redundant Condition
p_tcaphash_contcall != (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_contcall != (void *)0 cannot be false.
- A crashing bug occurs on every path where p_tcaphash_contcall != (void *)0 could have evaluated to false. Look for a preceding Null Pointer Dereference or Division By Zero warning.
|
|
| 557 | | | } else { |
| 558 | | | #ifdef DEBUG_TCAPSRT |
| 559 | | | dbg(23,"Not in Chash "); |
| 560 | | | #endif |
| 561 | | | } |
| 562 | | | return NULL; |
| 563 | | | } |
| |