(/home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/ngsniffer.c) |
| |
| 1207 | | | static gboolean ngsniffer_seek_read(wtap *wth, gint64 seek_off, |
| 1208 | | | union *, guchar *pd, int packet_size, |
| 1209 | | | int *err, gchar **err_info _U_) |
| 1210 | | | { |
| 1211 | | | int ret; |
| 1212 | | | guint16 type, length; |
| 1213 | | | struct frame2_rec frame2; |
| 1214 | | | struct frame4_rec frame4; |
| 1215 | | | struct frame6_rec frame6; |
| 1216 | | | |
| 1217 | | | if (ng_file_seek_rand(wth, seek_off, SEEK_SET, err) == -1)
x /usr/include/stdio.h |
| |
141 | #define SEEK_SET 0 /* Seek from beginning of file. */ |
| |
|
| 1218 | | | return FALSE; |
| 1219 | | | |
| 1220 | | | ret = (wth, TRUE, &type, &length, err); |
| 1221 | | | if (ret <= 0) { |
| 1222 | | | |
| 1223 | | | if (ret == 0) { |
| 1224 | | | |
| 1225 | | | *err = WTAP_ERR_SHORT_READ; |
| 1226 | | | } |
| 1227 | | | return FALSE; |
| 1228 | | | } |
| 1229 | | | |
| 1230 | | | switch (type) { |
| 1231 | | | |
| 1232 | | | case REC_FRAME2: |
| 1233 | | | |
| 1234 | | | if (!ngsniffer_read_frame2(wth, TRUE, &frame2, err)) { |
| 1235 | | | |
| 1236 | | | return FALSE; |
| 1237 | | | } |
| 1238 | | | |
| 1239 | | | length -= sizeof frame2; |
| 1240 | | | |
| 1241 | | | (wth, , &frame2); |
| 1242 | | | break; |
| 1243 | | | |
| 1244 | | | case REC_FRAME4: |
| 1245 | | | |
| 1246 | | | if (!ngsniffer_read_frame4(wth, TRUE, &frame4, err)) { |
| 1247 | | | |
| 1248 | | | return FALSE; |
| 1249 | | | } |
| 1250 | | | |
| 1251 | | | length -= sizeof frame4; |
| 1252 | | | |
| 1253 | | | (, &frame4); |
| 1254 | | | break; |
| 1255 | | | |
| 1256 | | | case REC_FRAME6:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/ngsniffer.c |
| |
82 | #define REC_FRAME6 12 /* Frame data (f_frame6) (see below) */ |
| |
|
| 1257 | | | |
| 1258 | | | if (!ngsniffer_read_frame6(wth, TRUE, &frame6, err)) { |
| 1259 | | | |
| 1260 | | | return FALSE; |
| 1261 | | | } |
| 1262 | | | |
| 1263 | | | length -= sizeof frame6; |
| 1264 | | | |
| 1265 | | | (wth, , &frame6); |
| 1266 | | | break; |
| 1267 | | | |
| 1268 | | | default: |
| 1269 | | | |
| 1270 | | | |
| 1271 | | | |
| 1272 | | | g_assert_not_reached();
x /usr/include/glib-2.0/glib/gtestutils.h |
| |
73 | #define g_assert_not_reached() do { g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, NULL); } while (0) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
160 | # define G_STRFUNC ((const char*) (__PRETTY_FUNCTION__)) |
| |
|
| 1273 | | | return FALSE; |
Unreachable Data Flow
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 1274 | | | } |
| 1275 | | | |
| 1276 | | | |
| 1277 | | | |
| 1278 | | | |
| 1279 | | | if (!ngsniffer_read_rec_data(wth, TRUE, pd, packet_size, err)) |
| 1280 | | | return FALSE; |
| 1281 | | | |
| 1282 | | | (wth->file_encap, pd, packet_size, ); |
| 1283 | | | |
| 1284 | | | return TRUE; |
| 1285 | | | } |
| |