(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.c) |
| |
| 994 | | | get_uint_value(tvbuff_t *tvb, gint offset, gint length, gboolean little_endian) |
| 995 | | | { |
| 996 | | | guint32 value; |
| 997 | | | |
| 998 | | | switch (length) { |
| 999 | | | |
| 1000 | | | case 1: |
| 1001 | | | value = tvb_get_guint8(tvb, offset); |
| 1002 | | | break; |
| 1003 | | | |
| 1004 | | | case 2: |
| 1005 | | | value = little_endian ? tvb_get_letohs(tvb, offset) |
| 1006 | | | : tvb_get_ntohs(tvb, offset); |
| 1007 | | | break; |
| 1008 | | | |
| 1009 | | | case 3: |
| 1010 | | | value = little_endian ? tvb_get_letoh24(tvb, offset) |
| 1011 | | | : tvb_get_ntoh24(tvb, offset); |
| 1012 | | | break; |
| 1013 | | | |
| 1014 | | | case 4: |
| 1015 | | | value = little_endian ? tvb_get_letohl(tvb, offset) |
| 1016 | | | : tvb_get_ntohl(tvb, offset); |
| 1017 | | | break; |
| 1018 | | | |
| 1019 | | | default: |
| 1020 | | | 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)) |
| |
|
| 1021 | | | value = 0; |
Unreachable Data Flow
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 1022 | | | break; |
| 1023 | | | } |
| 1024 | | | return value; |
| 1025 | | | } |
| |