Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Control Flow  at ngsniffer.c:2590

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

ng_file_seek_seq

(/home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/ngsniffer.c)expand/collapse
Show more  
 2570  ng_file_seek_seq(wtap *wth, gint64 offset, int whence, int *err)
 2571  {
 2572      gint64 delta;
 2573      char buf[65536];
 2574      long amount_to_read;
 2575   
 2576      if (wth->file_type == WTAP_FILE_NGSNIFFER_UNCOMPRESSED)
 2577          return file_seek(wth->fh, offset, whence, err);
 2578   
 2579      switch (whence) {
 2580   
 2581      case SEEK_SET:
 2582          break;          /* "offset" is the target offset */
 2583   
 2584      case SEEK_CUR:
 2585          offset += wth->capture.ngsniffer->seq.uncomp_offset;
 2586          break;          /* "offset" is relative to the current offset */
 2587   
 2588      case SEEK_END:
 2589          g_assert_not_reached(); /* "offset" is relative to the end of the file... */
 2590          break;          /* ...but we don't know where that is. */
 2591      }
 2592   
 2593      delta = offset - wth->capture.ngsniffer->seq.uncomp_offset;
 2594      g_assert(delta >= 0);
 2595   
 2596      /* Ok, now read and discard "delta" bytes. */
 2597      while (delta != 0) {
 2598          amount_to_read = (long) delta;
 2599          if ((unsigned long)amount_to_read > sizeof buf)
 2600              amount_to_read = sizeof buf;
 2601          if (ng_file_read(buf, 1, amount_to_read, wth, FALSE, err) < 0)
 2602              return -1;  /* error */
 2603          delta -= amount_to_read;
 2604      }
 2605      return offset;
 2606  }
Show more  




Change Warning 1036.30161 : Unreachable Control Flow

Priority:
State:
Finding:
Owner:
Note: