(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.c) |
| |
| 1028 | | | get_int_value(tvbuff_t *tvb, gint offset, gint length, gboolean little_endian) |
| 1029 | | | { |
| 1030 | | | gint32 value; |
| 1031 | | | |
| 1032 | | | switch (length) { |
| 1033 | | | |
| 1034 | | | case 1: |
| 1035 | | | value = (gint8)tvb_get_guint8(tvb, offset); |
| 1036 | | | break; |
| 1037 | | | |
| 1038 | | | case 2: |
| 1039 | | | value = (gint16) (little_endian ? tvb_get_letohs(tvb, offset) |
| 1040 | | | : tvb_get_ntohs(tvb, offset)); |
| 1041 | | | break; |
| 1042 | | | |
| 1043 | | | case 3: |
| 1044 | | | value = little_endian ? tvb_get_letoh24(tvb, offset) |
| 1045 | | | : tvb_get_ntoh24(tvb, offset); |
| 1046 | | | if (value & 0x00800000) { |
| 1047 | | | |
| 1048 | | | value |= 0xFF000000; |
| 1049 | | | } |
| 1050 | | | break; |
| 1051 | | | |
| 1052 | | | case 4: |
| 1053 | | | value = little_endian ? tvb_get_letohl(tvb, offset) |
| 1054 | | | : tvb_get_ntohl(tvb, offset); |
| 1055 | | | break; |
| 1056 | | | |
| 1057 | | | default: |
| 1058 | | | 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)) |
| |
|
| 1059 | | | value = 0; |
Unreachable Data Flow
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 1060 | | | break; |
| 1061 | | | } |
| 1062 | | | return value; |
| 1063 | | | } |
| |