Unreachable Computation at print.c:709 |
No properties have been set. edit properties |
Jump to warning location ↓ | warning details... |
| |
get_field_data (/home/sate/Testcases/c/cve/wireshark-1.2.0/print.c)![]() | ||||||
![]() | ||||||
675 | static const guint8 * | |||||
676 | get_field_data(GSList *src_list, field_info *fi) | |||||
677 | { | |||||
678 | GSList *src_le; | |||||
679 | data_source *src; | |||||
680 | tvbuff_t *src_tvb; | |||||
681 | gint length, tvbuff_length; | |||||
682 | ||||||
683 | for (src_le = src_list; src_le != NULL; src_le = src_le->next) { | |||||
684 | src = src_le->data; | |||||
685 | src_tvb = src->tvb; | |||||
686 | if (fi->ds_tvb == src_tvb) { | |||||
687 | /* | |||||
688 | * Found it. | |||||
689 | * | |||||
690 | * XXX - a field can have a length that runs past | |||||
691 | * the end of the tvbuff. Ideally, that should | |||||
692 | * be fixed when adding an item to the protocol | |||||
693 | * tree, but checking the length when doing | |||||
694 | * that could be expensive. Until we fix that, | |||||
695 | * we'll do the check here. | |||||
696 | */ | |||||
697 | tvbuff_length = tvb_length_remaining(src_tvb, | |||||
698 | fi->start); | |||||
699 | if (tvbuff_length < 0) { | |||||
700 | return NULL; | |||||
701 | } | |||||
702 | length = fi->length; | |||||
703 | if (length > tvbuff_length) | |||||
704 | length = tvbuff_length; | |||||
705 | return tvb_get_ptr(src_tvb, fi->start, length); | |||||
706 | } | |||||
707 | } | |||||
708 | g_assert_not_reached(); | |||||
709 | return NULL; /* not found */
| |||||
710 | } | |||||
![]() |