Ethereal-dev: [Ethereal-dev] minor bug in ethereal 0.9.5

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Liviu Daia <Liviu.Daia@xxxxxxx>
Date: Sun, 7 Jul 2002 22:02:19 +0300
    Trying to change the "column.format" preference from the command
line in ethereal and tethereal results in a segfault.  The patch below
seems to fix this problem; please consider it for inclusion in a
subsequent release of ethereal.

    Regards,

    Liviu Daia

-- 
Dr. Liviu Daia               e-mail:   Liviu.Daia@xxxxxxx
Institute of Mathematics     web page: http://www.imar.ro/~daia
of the Romanian Academy      PGP key:  http://www.imar.ro/~daia/daia.asc
diff -ur ethereal-0.9.5.old/gtk/main.c ethereal-0.9.5/gtk/main.c
--- ethereal-0.9.5.old/gtk/main.c	2002-06-01 17:20:04.000000000 +0300
+++ ethereal-0.9.5/gtk/main.c	2002-07-07 21:16:58.000000000 +0300
@@ -1394,7 +1394,6 @@
   cfile.has_snap	= FALSE;
   cfile.snap		= WTAP_MAX_PACKET_SIZE;
   cfile.count		= 0;
-  col_init(&cfile.cinfo, prefs->num_cols);
 
   /* Assemble the compile-time options */
   comp_info_str = g_string_new("");
@@ -1790,6 +1789,7 @@
 #endif
 
   /* Build the column format array */  
+  col_init(&cfile.cinfo, prefs->num_cols);
   for (i = 0; i < cfile.cinfo.num_cols; i++) {
     cfile.cinfo.col_fmt[i] = get_column_format(i);
     cfile.cinfo.col_title[i] = g_strdup(get_column_title(i));
diff -ur ethereal-0.9.5.old/tethereal.c ethereal-0.9.5/tethereal.c
--- ethereal-0.9.5.old/tethereal.c	2002-06-29 01:23:54.000000000 +0300
+++ ethereal-0.9.5/tethereal.c	2002-07-07 21:16:09.000000000 +0300
@@ -403,7 +403,6 @@
   cfile.has_snap	= FALSE;
   cfile.snap		= WTAP_MAX_PACKET_SIZE;
   cfile.count		= 0;
-  col_init(&cfile.cinfo, prefs->num_cols);
 
   /* Assemble the compile-time options */
   comp_info_str = g_string_new("");
@@ -756,6 +755,7 @@
   }
 
   /* Build the column format array */  
+  col_init(&cfile.cinfo, prefs->num_cols);
   for (i = 0; i < cfile.cinfo.num_cols; i++) {
     cfile.cinfo.col_fmt[i] = get_column_format(i);
     cfile.cinfo.col_title[i] = g_strdup(get_column_title(i));