(/home/sate/Testcases/c/cve/wireshark-1.2.0/merge.c) |
| |
| 154 | | | wtap * |
| 155 | | | merge_read_packet(int in_file_count, merge_in_file_t in_files[], int *err, |
| 156 | | | gchar **err_info) |
| 157 | | | { |
| 158 | | | int i; |
| 159 | | | int ei = -1; |
| 160 | | | struct wtap_nstime tv = { sizeof(time_t) > sizeof(int) ? LONG_MAX : INT_MAX, INT_MAX }; |
Unreachable Data Flow
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 161 | | | struct wtap_pkthdr *phdr; |
| 162 | | | |
| 163 | | | |
| 164 | | | |
| 165 | | | |
| 166 | | | |
| 167 | | | |
| 168 | | | for (i = 0; i < in_file_count; i++) { |
| 169 | | | if (in_files[i].state == PACKET_NOT_PRESENT) { |
| 170 | | | |
| 171 | | | |
| 172 | | | |
| 173 | | | |
| 174 | | | if (!wtap_read(in_files[i].wth, err, err_info, &in_files[i].data_offset)) { |
| 175 | | | if (*err != 0) { |
| 176 | | | in_files[i].state = GOT_ERROR; |
| 177 | | | return NULL; |
| 178 | | | } |
| 179 | | | in_files[i].state = AT_EOF; |
| 180 | | | } else |
| 181 | | | in_files[i].state = PACKET_PRESENT; |
| 182 | | | } |
| 183 | | | |
| 184 | | | if (in_files[i].state == PACKET_PRESENT) { |
| 185 | | | phdr = wtap_phdr(in_files[i].wth); |
| 186 | | | if (is_earlier(&phdr->ts, &tv)) { |
| 187 | | | tv = phdr->ts; |
| 188 | | | ei = i; |
| 189 | | | } |
| 190 | | | } |
| 191 | | | } |
| 192 | | | |
| 193 | | | if (ei == -1) { |
| 194 | | | |
| 195 | | | *err = 0; |
| 196 | | | return NULL; |
| 197 | | | } |
| 198 | | | |
| 199 | | | |
| 200 | | | in_files[ei].state = PACKET_NOT_PRESENT; |
| 201 | | | |
| 202 | | | |
| 203 | | | return in_files[ei].wth; |
| 204 | | | } |
| |