(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/tvbuff.c) |
| |
| 1787 | | | tvb_pbrk_guint8(tvbuff_t *tvb, gint offset, gint maxlength, const guint8 *needles) |
| 1788 | | | { |
| 1789 | | | const guint8 *result; |
| 1790 | | | guint abs_offset, junk_length; |
| 1791 | | | guint tvbufflen; |
| 1792 | | | guint limit; |
| 1793 | | | |
| 1794 | | | check_offset_length(tvb, offset, 0, &abs_offset, &junk_length); |
| 1795 | | | |
| 1796 | | | |
| 1797 | | | tvbufflen = tvb_length_remaining(tvb, abs_offset); |
| 1798 | | | if (maxlength == -1) { |
| 1799 | | | |
| 1800 | | | limit = tvbufflen; |
| 1801 | | | } |
| 1802 | | | else if (tvbufflen < (guint) maxlength) { |
| 1803 | | | |
| 1804 | | | |
| 1805 | | | limit = tvbufflen; |
| 1806 | | | } |
| 1807 | | | else { |
| 1808 | | | |
| 1809 | | | |
| 1810 | | | limit = maxlength; |
| 1811 | | | } |
| 1812 | | | |
| 1813 | | | |
| 1814 | | | if (tvb->real_data) { |
| 1815 | | | result = guint8_pbrk(tvb->real_data + abs_offset, limit, needles); |
| 1816 | | | if (result == NULL) { |
| 1817 | | | return -1; |
| 1818 | | | } |
| 1819 | | | else { |
| 1820 | | | return (gint) (result - tvb->real_data); |
| 1821 | | | } |
| 1822 | | | } |
| 1823 | | | |
| 1824 | | | switch(tvb->type) { |
| 1825 | | | case TVBUFF_REAL_DATA: |
| 1826 | | | 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)) |
| |
|
| 1827 | | | |
| 1828 | | | case TVBUFF_SUBSET: |
| 1829 | | | return tvb_pbrk_guint8(tvb->tvbuffs.subset.tvb, |
| 1830 | | | abs_offset - tvb->tvbuffs.subset.offset, |
| 1831 | | | limit, needles); |
| 1832 | | | |
| 1833 | | | case TVBUFF_COMPOSITE: |
| 1834 | | | 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)) |
| |
|
| 1835 | | | |
| 1836 | | | } |
| 1837 | | | |
| 1838 | | | 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)) |
| |
|
| 1839 | | | return -1; |
Unreachable Computation
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 1840 | | | } |
| |