Text   |  XML   |  ReML   |   Visible Warnings:

Ignored Return Value  at packet-asn1.c:2830

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

read_asn1_type_table

(/home/sate/Testcases/c/cve/wireshark-1.2.0/plugins/asn1/packet-asn1.c)expand/collapse
Show more  
 2803  read_asn1_type_table(const char *filename)
 2804  {
 2805          FILE *f;
 2806          guint size;
 2807          guchar *data;
 2808          struct stat stat;
 2809          static guint mylogh = 0;
 2810   
 2811          if ((filename == 0) || (strlen(filename) == 0))
 2812                  return;         /* no filename provided */
 2813   
 2814          f = ws_fopen(filename, "rb");
 2815          if (f == 0) {
 2816                  /*
 2817                   * Ignore "file not found" errors if it's the old default 
 2818                   * ASN.1 file name, as we never shipped such a file.
 2819                   * Also, on Win32, ignore the earlier default, which 
 2820                   * had a "/" rather than a "\" as the last pathname
 2821                   * separator.
 2822                   */
 2823  #ifdef _WIN32 
 2824                  if (strcmp(filename, bad_separator_old_default_asn1_filename) != 0)
 2825  #endif
 2826                          if ((strcmp(filename, old_default_asn1_filename) != 0) || errno != ENOENT)
 2827                                  report_open_failure(filename, errno, FALSE);
 2828                  return;
 2829          }
 2830          fstat(fileno(f), &stat);
 2831          size = (int)stat.st_size;
 2832          if (size == 0) {
 2833                  if (asn1_verbose) g_message("file %s is empty, ignored", filename);
 2834                  fclose(f);
 2835                  return;
 2836          }
 2837          if (asn1_verbose) g_message("reading %d bytes from %s", size, filename);
 2838   
 2839          data = g_malloc(size);
 2840          if (fread(data, size, 1, f) < 1) {
 2841                  g_warning("error reading %s, %s", filename, strerror(errno));
 2842          }
 2843          fclose(f);
 2844   
 2845          if (asn1_verbose) {
 2846            /* ***** from the time when logging was just in a console... *****
 2847             * g_message("******* Type ^S and change console buffer size to 9999 and type ^Q *******\n"
 2848             *            "  Sleep 5 sec...");
 2849             * Sleep(5 * 1000);
 2850             */
 2851   
 2852   
 2853                  g_message("logging to file %s", asn1_logfile);
 2854   
 2855                  if (mylogh == 0) {
 2856                          mylogh = g_log_set_handler (NULL, G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL 
 2857                                                      | G_LOG_FLAG_RECURSION, my_log_handler, NULL);
 2858                  }
 2859          }
 2860   
 2861          asn1_desc = tvb_new_real_data(data, size, size);
 2862   
 2863          tt_build_tree();
 2864          if (asn1_verbose) g_message("read %d items from %s", icount, filename);
 2865   
 2866  #if 0 
 2867          list_modules();
 2868  #endif
 2869   
 2870          get_values();
 2871   
 2872          g_node_destroy(asn1_nodes);     asn1_nodes = 0;
 2873  #ifndef _WIN32          /* tvb_free not yet exported to plugins... */
 2874          tvb_free(asn1_desc);
 2875  #endif
 2876                                          asn1_desc = 0;
 2877          g_free(data);                   data = 0;
 2878   
 2879          showGNodes(data_nodes, 0);
 2880   
 2881          debug_dump_TT();
 2882  }
Show more  




Change Warning 5532.35818 : Ignored Return Value

Priority:
State:
Finding:
Owner:
Note: