(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/tvbparse.c) |
| |
| 754 | | | static int cond_until(tvbparse_t* tt, int offset, const tvbparse_wanted_t * wanted, tvbparse_elem_t** tok) { |
| 755 | | | tvbparse_elem_t* new = NULL; |
| 756 | | | int len = 0; |
| 757 | | | int target_offset = offset; |
| 758 | | | #ifdef TVBPARSE_DEBUG |
| 759 | | | if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_UNTIL) g_warning("cond_until: START"); |
| 760 | | | #endif |
| 761 | | | |
| 762 | | | if ( offset + wanted->control.until.subelem->len > tt->end_offset ) |
| 763 | | | return -1; |
| 764 | | | |
| 765 | | | do { |
| 766 | | | len = wanted->control.until.subelem->condition(tt, target_offset++, wanted->control.until.subelem, &new); |
| 767 | | | } while(len < 0 && target_offset+1 < tt->end_offset); |
| 768 | | | |
| 769 | | | if (len >= 0) { |
| 770 | | | |
| 771 | | | new->id = wanted->id; |
| 772 | | | new->next = NULL; |
| 773 | | | new->last = NULL; |
| 774 | | | new->wanted = wanted; |
| 775 | | | new->offset = offset; |
| 776 | | | |
| 777 | | | (*tok) = new; |
| 778 | | | |
| 779 | | | switch (wanted->control.until.mode) { |
| 780 | | | case TP_UNTIL_INCLUDE: |
| 781 | | | new->len = target_offset - offset - 1 + len; |
| 782 | | | #ifdef TVBPARSE_DEBUG |
| 783 | | | if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_UNTIL) g_warning("cond_until: GOT len=%i",target_offset - offset -1 + len); |
| 784 | | | #endif |
| 785 | | | return target_offset - offset -1 + len; |
| 786 | | | case TP_UNTIL_SPEND: |
| 787 | | | new->len = target_offset - offset - 1; |
| 788 | | | #ifdef TVBPARSE_DEBUG |
| 789 | | | if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_UNTIL) g_warning("cond_until: GOT len=%i",target_offset - offset -1 + len); |
| 790 | | | #endif |
| 791 | | | return target_offset - offset - 1 + len; |
| 792 | | | case TP_UNTIL_LEAVE: |
| 793 | | | new->len = target_offset - offset - 1; |
| 794 | | | #ifdef TVBPARSE_DEBUG |
| 795 | | | if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_UNTIL) g_warning("cond_until: GOT len=%i",target_offset - offset -1); |
| 796 | | | #endif |
| 797 | | | return target_offset - offset -1; |
| 798 | | | default: |
| 799 | | | DISSECTOR_ASSERT_NOT_REACHED();
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
131 | #define DISSECTOR_ASSERT_NOT_REACHED() \ |
132 | (REPORT_DISSECTOR_BUG( \ |
133 | ep_strdup_printf("%s:%u: failed assertion \"DISSECTOR_ASSERT_NOT_REACHED\"", \ |
134 | __FILE__, __LINE__))) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
106 | #define REPORT_DISSECTOR_BUG(message) \ |
107 | ((getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL) ? \ |
108 | abort() : \ |
109 | THROW_MESSAGE(DissectorError, message)) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
226 | #define THROW_MESSAGE(x, y) \ |
227 | except_throw(XCEPT_GROUP_WIRESHARK, (x), (y)) |
| |
|
| 800 | | | return -1; |
Unreachable Computation
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 801 | | | } |
| 802 | | | |
| 803 | | | } else { |
| 804 | | | return -1; |
| 805 | | | } |
| 806 | | | } |
| |