Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Call  at file.c:711

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

cf_continue_tail

(/home/sate/Testcases/c/cve/wireshark-1.2.0/file.c)expand/collapse
Show more  
 655  cf_continue_tail(capture_file *cf, volatile int to_read, int *err)
 656  {
 657    gint64 data_offset = 0;
 658    gchar *err_info;
 659    volatile int newly_displayed_packets = 0;
 660    dfilter_t   *dfcode;
 661   
 662    /* Compile the current display filter.
 663     * We assume this will not fail since cf->dfilter is only set in
 664     * cf_filter IFF the filter was valid.
 665     */
 666    dfcode=NULL;
 667    if(cf->dfilter){
 668      dfilter_compile(cf->dfilter, &dfcode);
 669    }
 670   
 671    *err = 0;
 672   
 673    packet_list_check_end();
 674    packet_list_freeze();
 675   
 676    /*g_log(NULL, G_LOG_LEVEL_MESSAGE, "cf_continue_tail: %u new: %u", cf->count, to_read);*/
 677   
 678    while (to_read != 0 && (wtap_read(cf->wth, err, &err_info, &data_offset))) {
 679      if (cf->state == FILE_READ_ABORTED) {
 680        /* Well, the user decided to exit Wireshark.  Break out of the 
 681           loop, and let the code below (which is called even if there 
 682           aren't any packets left to read) exit. */
 683        break;
 684      }
 685      TRY{
 686          if (read_packet(cf, dfcode, data_offset) != -1) {
 687              newly_displayed_packets++;
 688          }
 689      }
 690      CATCH(OutOfMemoryError) {
 691          gpointer dialog;
 692   
 693          dialog = simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
 694                "%sOut Of Memory!%s\n"
 695                "\n"
 696                "Sorry, but Wireshark has to terminate now!\n"
 697                "\n"
 698                "The capture file is not lost, it can be found at:\n"
 699                "%s\n"
 700                "\n"
 701                "Some infos / workarounds can be found at:\n"
 702                "http://wiki.wireshark.org/KnownBugs/OutOfMemory",
 703                simple_dialog_primary_start(), simple_dialog_primary_end(), cf->filename);
 704          /* we have to terminate, as we cannot recover from the memory error */
 705          simple_dialog_set_cb(dialog, outofmemory_cb, NULL);
 706          while(1) {
 707              main_window_update();
 708              /* XXX - how to avoid a busy wait? */
 709              /* Sleep(100); */
 710          };
 711          packet_list_thaw();
 712          return CF_READ_ABORTED;
 713      }
 714      ENDTRY;
 715      to_read--;
 716    }
 717   
 718    /* Cleanup and release all dfilter resources */
 719    if (dfcode != NULL){
 720      dfilter_free(dfcode);
 721    }
 722   
 723    /*g_log(NULL, G_LOG_LEVEL_MESSAGE, "cf_continue_tail: count %u state: %u err: %u",
 724            cf->count, cf->state, *err);*/
 725   
 726    /* XXX - this causes "flickering" of the list */
 727    packet_list_thaw();
 728   
 729    /* moving to the end of the packet list - if the user requested so and
 730       we have some new packets.
 731       this doesn't seem to work well with a frozen GTK_Clist, so do this after
 732       packet_list_thaw() is done, see bugzilla 1188 */
 733    /* XXX - this cheats and looks inside the packet list to find the final
 734       row number. */
 735    if (newly_displayed_packets && auto_scroll_live && cf->plist_end != NULL)
 736      packet_list_moveto_end();
 737   
 738    if (cf->state == FILE_READ_ABORTED) {
 739      /* Well, the user decided to exit Wireshark.  Return CF_READ_ABORTED 
 740         so that our caller can kill off the capture child process;
 741         this will cause an EOF on the pipe from the child, so 
 742         "cf_finish_tail()" will be called, and it will clean up 
 743         and exit. */
 744      return CF_READ_ABORTED;
 745    } else if (*err != 0) {
 746      /* We got an error reading the capture file.
 747         XXX - pop up a dialog box instead? */
 748          g_warning("Error \"%s\" while reading: \"%s\"\n",
 749                  wtap_strerror(*err), cf->filename);
 750   
 751      return CF_READ_ERROR;
 752    } else 
 753      return CF_READ_OK;
 754  }
Show more  




Change Warning 4705.31747 : Unreachable Call

Priority:
State:
Finding:
Owner:
Note: