Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Data Flow  at merge.c:160

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

merge_read_packet

(/home/sate/Testcases/c/cve/wireshark-1.2.0/merge.c)expand/collapse
Show more  
 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 };
 161    struct wtap_pkthdr *phdr;
 162   
 163    /*
 164     * Make sure we have a packet available from each file, if there are any
 165     * packets left in the file in question, and search for the packet 
 166     * with the earliest time stamp.
 167     */
 168    for (i = 0; i < in_file_count; i++) {
 169      if (in_files[i].state == PACKET_NOT_PRESENT) {
 170        /*
 171         * No packet available, and we haven't seen an error or EOF yet,
 172         * so try to read the next packet.
 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      /* All the streams are at EOF.  Return an EOF indication. */
 195      *err = 0;
 196      return NULL;
 197    }
 198   
 199    /* We'll need to read another packet from this file. */
 200    in_files[ei].state = PACKET_NOT_PRESENT;
 201   
 202    /* Return a pointer to the wtap structure for the file with that frame. */
 203    return in_files[ei].wth;
 204  }
Show more  




Change Warning 3978.29631 : Unreachable Data Flow

Priority:
State:
Finding:
Owner:
Note: