gnumeric r16443 - in trunk: . plugins/applix



Author: mortenw
Date: Fri Mar  7 00:05:23 2008
New Revision: 16443
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16443&view=rev

Log:
2008-03-06  Morten Welinder  <terra gnome org>

	* applix-read.c (applix_read): Fix null deref.  #520873.



Modified:
   trunk/NEWS
   trunk/plugins/applix/ChangeLog
   trunk/plugins/applix/applix-read.c

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Fri Mar  7 00:05:23 2008
@@ -44,7 +44,7 @@
 	* Fix corrupted-sylk-bug.
 	* Make <control>KP_Subtract work as <control>minus.  [#516358]
 	* Make <control>KP_Add work as <control>plus.
-	* Fix corrupted-applix-bugs.  [#517778]
+	* Fix corrupted-applix-bugs.  [#517778] [#520873]
 	* Fix autofill issue with merged cells.  [#504191]
 	* Fix sylk importer's format handling.
 	* Fix memory allocation failure for huge .gnumeric files.  [#519319]

Modified: trunk/plugins/applix/applix-read.c
==============================================================================
--- trunk/plugins/applix/applix-read.c	(original)
+++ trunk/plugins/applix/applix-read.c	Fri Mar  7 00:05:23 2008
@@ -1664,10 +1664,13 @@
 	g_slist_free (state.sheet_order);
 
 	renamed_sheets = NULL;
-	for (ptr = state.std_names; ptr != NULL ; ptr = ptr->next)
+	for (ptr = state.std_names; ptr != NULL ; ptr = ptr->next) {
+		const char *name = ptr->data;
+		Sheet *sheet = workbook_sheet_by_name (state.wb, name);
+		int idx = sheet ? sheet->index_in_wb : -1;
 		renamed_sheets = g_slist_prepend (renamed_sheets,
-			GINT_TO_POINTER (workbook_sheet_by_name
-					 (state.wb, ptr->data)->index_in_wb));
+						  GINT_TO_POINTER (idx));
+	}
 	renamed_sheets = g_slist_reverse (renamed_sheets);
 	workbook_sheet_rename (state.wb, renamed_sheets,
 			       state.real_names,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]