(/home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/pcap-common.c) |
| |
| 1011 | | | (FILE_T fh, union *, |
| 1012 | | | int *err, gchar **err_info _U_, guint * psize) |
| 1013 | | | { |
| 1014 | | | int bytes_read = 0; |
| 1015 | | | guint8 erf_exhdr[8]; |
| 1016 | | | guint64 erf_exhdr_sw; |
| 1017 | | | int i = 0, max = sizeof(->erf.ehdr_list)/sizeof(struct erf_ehdr); |
| 1018 | | | guint8 type = ->erf.phdr.type; |
Unused Value
The value assigned to type is never subsequently used on any execution path. |
|
| 1019 | | | *psize = 0; |
| 1020 | | | if (->erf.phdr.type & 0x80){ |
| 1021 | | | do{ |
| 1022 | | | errno = WTAP_ERR_CANT_READ; |
| 1023 | | | bytes_read = file_read(erf_exhdr, 1, 8, fh);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/file_wrappers.h |
| |
36 | #define file_read(buf, bsize, count, file) gzread((file),(buf),(unsigned)((count)*(bsize))) |
| |
|
| 1024 | | | if (bytes_read != 8 ) { |
| 1025 | | | *err = file_error(fh); |
| 1026 | | | if (*err == 0) |
| 1027 | | | *err = WTAP_ERR_SHORT_READ; |
| 1028 | | | return FALSE; |
| 1029 | | | } |
| 1030 | | | type = erf_exhdr[0]; |
| 1031 | | | erf_exhdr_sw = pntohll((guint64*) &(erf_exhdr[0]));
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/wtap-int.h |
| |
361 | #define pntohll(p) ((guint64)*((const guint8 *)(p)+0)<<56| \ |
362 | (guint64)*((const guint8 *)(p)+1)<<48| \ |
363 | (guint64)*((const guint8 *)(p)+2)<<40| \ |
364 | (guint64)*((const guint8 *)(p)+3)<<32| \ |
365 | (guint64)*((const guint8 *)(p)+4)<<24| \ |
366 | (guint64)*((const guint8 *)(p)+5)<<16| \ |
367 | (guint64)*((const guint8 *)(p)+6)<<8| \ |
368 | (guint64)*((const guint8 *)(p)+7)<<0) |
| |
|
| 1032 | | | if (i < max) |
| 1033 | | | memcpy(&->erf.ehdr_list[i].ehdr, &erf_exhdr_sw, sizeof(erf_exhdr_sw)); |
| 1034 | | | *psize += 8; |
| 1035 | | | i++; |
| 1036 | | | } while (type & 0x80); |
| 1037 | | | } |
| 1038 | | | return TRUE; |
| 1039 | | | } |
| |