Unreachable Computation at addr_resolv.c:2709 |
No properties have been set. edit properties |
Jump to warning location ↓ | warning details... |
| |
get_ether_name_if_known (/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/addr_resolv.c)![]() | ||||||
![]() | ||||||
2658 | gchar *get_ether_name_if_known(const guint8 *addr) | |||||
2659 | { | |||||
2660 | int hash_idx; | |||||
2661 | hashether_t *tp; | |||||
2662 | ||||||
2663 | /* Initialize ether structs if we're the first | |||||
2664 | * ether- function called */ | |||||
2665 | if (!(g_resolv_flags & RESOLV_MAC)) | |||||
2666 | return NULL; | |||||
2667 | ||||||
2668 | if (!eth_resolution_initialized) { | |||||
2669 | initialize_ethers(); | |||||
2670 | eth_resolution_initialized = 1; | |||||
2671 | } | |||||
2672 | ||||||
2673 | hash_idx = HASH_ETH_ADDRESS(addr); | |||||
2674 | ||||||
2675 | tp = eth_table[hash_idx]; | |||||
2676 | ||||||
2677 | if( tp == NULL ) { | |||||
2678 | /* Hash key not found in table. | |||||
2679 | * Force a lookup (and a hash entry) for addr, then call | |||||
2680 | * myself. I plan on not getting into an infinite loop because | |||||
2681 | * eth_name_lookup() is guaranteed to make a hashtable entry, | |||||
2682 | * so when I call myself again, I can never get into this | |||||
2683 | * block of code again. Knock on wood... | |||||
2684 | */ | |||||
2685 | (void) eth_name_lookup(addr); | |||||
2686 | return get_ether_name_if_known(addr); /* a well-placed goto would suffice */ | |||||
2687 | } | |||||
2688 | else { | |||||
2689 | while(1) { | |||||
2690 | if (memcmp(tp->addr, addr, sizeof(tp->addr)) == 0) { | |||||
2691 | if (!tp->is_dummy_entry) { | |||||
2692 | /* A name was found, and its origin is an ethers file */ | |||||
2693 | return tp->name; | |||||
2694 | } | |||||
2695 | else { | |||||
2696 | /* A name was found, but it was created, not found in a file */ | |||||
2697 | return NULL; | |||||
2698 | } | |||||
2699 | } | |||||
2700 | if (tp->next == NULL) { | |||||
2701 | /* Read my reason above for why I'm sure I can't get into an infinite loop */ | |||||
2702 | (void) eth_name_lookup(addr); | |||||
2703 | return get_ether_name_if_known(addr); /* a well-placed goto would suffice */ | |||||
2704 | } | |||||
2705 | tp = tp->next; | |||||
2706 | } | |||||
2707 | } | |||||
2708 | g_assert_not_reached(); | |||||
2709 | return NULL;
| |||||
2710 | } | |||||
![]() |