(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/tvbuff.c) |
| |
| 1724 | | | tvb_find_guint8(tvbuff_t *tvb, gint offset, gint maxlength, guint8 needle) |
| 1725 | | | { |
| 1726 | | | const guint8 *result; |
| 1727 | | | guint abs_offset, junk_length; |
| 1728 | | | guint tvbufflen; |
| 1729 | | | guint limit; |
| 1730 | | | |
| 1731 | | | check_offset_length(tvb, offset, 0, &abs_offset, &junk_length); |
| 1732 | | | |
| 1733 | | | |
| 1734 | | | tvbufflen = tvb_length_remaining(tvb, abs_offset); |
| 1735 | | | if (maxlength == -1) { |
| 1736 | | | |
| 1737 | | | limit = tvbufflen; |
| 1738 | | | } |
| 1739 | | | else if (tvbufflen < (guint) maxlength) { |
| 1740 | | | |
| 1741 | | | |
| 1742 | | | limit = tvbufflen; |
| 1743 | | | } |
| 1744 | | | else { |
| 1745 | | | |
| 1746 | | | |
| 1747 | | | limit = maxlength; |
| 1748 | | | } |
| 1749 | | | |
| 1750 | | | |
| 1751 | | | if (tvb->real_data) { |
| 1752 | | | result = guint8_find(tvb->real_data + abs_offset, limit, needle); |
| 1753 | | | if (result == NULL) { |
| 1754 | | | return -1; |
| 1755 | | | } |
| 1756 | | | else { |
| 1757 | | | return (gint) (result - tvb->real_data); |
| 1758 | | | } |
| 1759 | | | } |
| 1760 | | | |
| 1761 | | | switch(tvb->type) { |
| 1762 | | | case TVBUFF_REAL_DATA: |
| 1763 | | | 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)) |
| |
|
| 1764 | | | |
| 1765 | | | case TVBUFF_SUBSET: |
| 1766 | | | return tvb_find_guint8(tvb->tvbuffs.subset.tvb, |
| 1767 | | | abs_offset - tvb->tvbuffs.subset.offset, |
| 1768 | | | limit, needle); |
| 1769 | | | |
| 1770 | | | case TVBUFF_COMPOSITE: |
| 1771 | | | 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)) |
| |
|
| 1772 | | | |
| 1773 | | | } |
| 1774 | | | |
| 1775 | | | 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)) |
| |
|
| 1776 | | | return -1; |
Unreachable Computation
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 1777 | | | } |
| |