Text   |  XML   |  ReML   |   Visible Warnings:

Buffer Underrun  at file_dlg.c:232

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

main

(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/main.c)expand/collapse
Show more  
 1768  main(int argc, char *argv[])
 1769  {
 1770    char                *init_progfile_dir_error;
 1771    char                *s;
 1772    int                  opt;
 1773    extern char         *optarg;
 1774    gboolean             arg_error = FALSE;
 1775   
 1776    extern int           splash_register_freq;  /* Found in about_dlg.c */
 1777    const gchar         *filter;
 1778   
 1779  #ifdef _WIN32 
 1780    WSADATA              wsaData;
 1781  #endif  /* _WIN32 */
 1782   
 1783    char                *rf_path;
 1784    int                  rf_open_errno;
 1785    char                *gdp_path, *dp_path;
 1786    int                  err;
 1787  #ifdef HAVE_LIBPCAP 
 1788    gboolean             start_capture = FALSE;
 1789    gboolean             list_link_layer_types = FALSE;
 1790  #else
 1791    gboolean             capture_option_specified = FALSE;
 1792  #endif
 1793    gint                 pl_size = 280, tv_size = 95, bv_size = 75;
 1794    gchar               *rc_file, *cf_name = NULL, *rfilter = NULL;
 1795    dfilter_t           *rfcode = NULL;
 1796    gboolean             rfilter_parse_failed = FALSE;
 1797    e_prefs             *prefs;
 1798    char                 badopt;
 1799    GtkWidget           *splash_win = NULL;
 1800    gpointer             priv_warning_dialog;
 1801    GLogLevelFlags       log_flags;
 1802    guint                go_to_packet = 0;
 1803    int                  optind_initial;
 1804    int                  status;
 1805    gchar               *cur_user, *cur_group;
 1806   
 1807  #ifdef _WIN32 
 1808  #ifdef HAVE_AIRPCAP 
 1809    char                  *err_str;
 1810  #endif
 1811  #endif
 1812   
 1813  #define OPTSTRING_INIT "a:b:c:C:Df:g:Hhi:kK:lLm:nN:o:P:pQr:R:Ss:t:vw:X:y:z:"
 1814   
 1815  #if defined HAVE_LIBPCAP && defined _WIN32
 1816  #define OPTSTRING_WIN32 "B:"
 1817  #else
 1818  #define OPTSTRING_WIN32 ""
 1819  #endif
 1820   
 1821    char optstring[sizeof(OPTSTRING_INIT) + sizeof(OPTSTRING_WIN32) - 1] =
 1822      OPTSTRING_INIT OPTSTRING_WIN32;
 1823   
 1824    /*
 1825     * Get credential information for later use, and drop privileges 
 1826     * before doing anything else.
 1827     * Let the user know if anything happened.
 1828     */
 1829    get_credential_info();
 1830    relinquish_special_privs_perm();
 1831   
 1832    /*
 1833     * Attempt to get the pathname of the executable file.
 1834     */
 1835    init_progfile_dir_error = init_progfile_dir(argv[0], main);
 1836   
 1837    /* initialize the funnel mini-api */
 1838    initialize_funnel_ops();
 1839   
 1840  #ifdef  HAVE_AIRPDCAP
 1841    AirPDcapInitContext(&airpdcap_ctx);
 1842  #endif
 1843   
 1844  #ifdef _WIN32 
 1845    /* Load wpcap if possible. Do this before collecting the run-time version information */
 1846    load_wpcap();
 1847   
 1848    /* ... and also load the packet.dll from wpcap */
 1849    wpcap_packet_load();
 1850   
 1851  #ifdef HAVE_AIRPCAP 
 1852
1887
Show [ Lines 1852 to 1887 omitted. ]
 1888        break;
 1889  #endif
 1890    }
 1891  #endif /* HAVE_AIRPCAP */
 1892   
 1893    /* Start windows sockets */
 1894    WSAStartup( MAKEWORD( 1, 1 ), &wsaData );
 1895  #endif  /* _WIN32 */
 1896   
 1897    /* Assemble the compile-time version information string */
 1898    comp_info_str = g_string_new("Compiled ");
 1899   
 1900    g_string_append(comp_info_str, "with ");
 1901    g_string_append_printf(comp_info_str,
 1902  #ifdef GTK_MAJOR_VERSION 
 1903                      "GTK+ %d.%d.%d", GTK_MAJOR_VERSION, GTK_MINOR_VERSION,
 1904                      GTK_MICRO_VERSION);
 1905  #else
 1906                      "GTK+ (version unknown)");
 1907  #endif
 1908    g_string_append(comp_info_str, ", ");
 1909   
 1910    get_compiled_version_info(comp_info_str, get_gui_compiled_info);
 1911   
 1912    /* Assemble the run-time version information string */
 1913    runtime_info_str = g_string_new("Running ");
 1914    get_runtime_version_info(runtime_info_str, get_gui_runtime_info);
 1915   
 1916    /* Read the profile independent recent file.  We have to do this here so we can */
 1917    /* set the profile before it can be set from the command line parameterts */
 1918[+]   recent_read_static(&rf_path, &rf_open_errno);
 1919    if (rf_path != NULL && rf_open_errno != 0) {
 1920      simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
 1921                    "Could not open common recent file\n\"%s\": %s.",
 1922                    rf_path, strerror(rf_open_errno));
 1923    }
 1924   
 1925    /* "pre-scan" the command line parameters, if we have "console only"
 1926       parameters.  We do this so we don't start GTK+ if we're only showing
 1927       command-line help or version information.
 1928   
 1929       XXX - this pre-scan is done before we start GTK+, so we haven't
 1930       run gtk_init() on the arguments.  That means that GTK+ arguments 
 1931       have not been removed from the argument list; those arguments
 1932       begin with "--", and will be treated as an error by getopt().
 1933   
 1934       We thus ignore errors - *and* set "opterr" to 0 to suppress the 
 1935       error messages. */
 1936    opterr = 0;
 1937    optind_initial = optind;
 1938    while ((opt = getopt(argc, argv, optstring)) != -1) {
 1939      switch (opt) {
 1940        case 'C':        /* Configuration Profile */
 1941          if (profile_exists (optarg)) {
 1942            set_profile_name (optarg);
 1943          } else {
 1944            cmdarg_err("Configuration Profile \"%s\" does not exist", optarg);
 1945            exit(1);
 1946          }
 1947          break;
 1948        case 'h':        /* Print help and exit */
 1949
1973
Show [ Lines 1949 to 1973 omitted. ]
 1974           */
 1975          ex_opt_add(optarg);
 1976          break;
 1977        case '?':        /* Ignore errors - the "real" scan will catch them. */
 1978          break;
 1979      }
 1980    }
 1981   
 1982    /* Init the "Open file" dialog directory */
 1983    /* (do this after the path settings are processed) */
 1984[+][+]   set_last_open_dir(get_persdatafile_dir());
expand/collapse

set_last_open_dir

(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/file_dlg.c)expand/collapse
Show more  
 225  set_last_open_dir(char *dirname)
 226  {
 227          size_t len;
 228          gchar *new_last_open_dir;
 229   
 230          if (dirname) {
 231                  len = strlen(dirname);
 232                  if (dirname[len-1] == G_DIR_SEPARATOR) {
Show more  
Show more  




Change Warning 4175.33542 : Buffer Underrun

Priority:
State:
Finding:
Owner:
Note: