(/home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/toshiba.c) |
| |
| 268 | | | toshiba_seek_read (wtap *wth, gint64 seek_off, |
| 269 | | | union *, guint8 *pd, int len, |
| 270 | | | int *err, gchar **err_info) |
| 271 | | | { |
| 272 | | | int pkt_len; |
| 273 | | | |
| 274 | | | if (file_seek(wth->random_fh, seek_off - 1, SEEK_SET, err) == -1)
x /usr/include/stdio.h |
| |
141 | #define SEEK_SET 0 /* Seek from beginning of file. */ |
| |
|
| 275 | | | return FALSE; |
| 276 | | | |
| 277 | | | pkt_len = parse_toshiba_rec_hdr(NULL, wth->random_fh, , |
| 278 | | | err, err_info); |
| 279 | | | |
| 280 | | | if (pkt_len != len) { |
| 281 | | | if (pkt_len != -1) { |
Redundant Condition
pkt_len != -1 always evaluates to false. This may be because: - There is a constant assignment to one or more of the variables involved.
- An earlier conditional statement has already ensured that pkt_len != -1 cannot be true.
- A crashing bug occurs on every path where pkt_len != -1 could have evaluated to true. Look for a preceding Null Pointer Dereference or Division By Zero warning.
|
|
| 282 | | | *err = WTAP_ERR_BAD_RECORD; |
| 283 | | | *err_info = g_strdup_printf("toshiba: requested length %d doesn't match record length %d", |
| 284 | | | len, pkt_len); |
| 285 | | | } |
| 286 | | | return FALSE; |
| 287 | | | } |
| 288 | | | |
| 289 | | | return parse_toshiba_hex_dump(wth->random_fh, pkt_len, pd, err, err_info); |
| 290 | | | } |
| |