[gnumeric] ODS: Fix crash on import.



commit 359f8367c73ce08add05a4d32be064e2bda24894
Author: Morten Welinder <terra gnome org>
Date:   Tue Dec 15 12:48:09 2009 -0500

    ODS: Fix crash on import.

 NEWS                                 |    1 +
 plugins/openoffice/ChangeLog         |    5 +++++
 plugins/openoffice/openoffice-read.c |    4 ++--
 3 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index 8cfd4ce..2af13fb 100644
--- a/NEWS
+++ b/NEWS
@@ -24,6 +24,7 @@ Morten:
 	* Fix DATEDIF problem across bogus 1900-02-29.  [#599461]
 	* Fix graph editor crash.  [#604223]
 	* Fix goal seek problems.
+	* Fix ODS import crash.  [#604615]
 
 --------------------------------------------------------------------------
 Gnumeric 1.9.16
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index e626111..3e12ba8 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,8 @@
+2009-12-15  Morten Welinder  <terra gnome org>
+
+	* openoffice-read.c (oo_col_start, oo_row_start): Allocate the
+	right amount of memory.  Fixes #604615.
+
 2009-12-04  Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* openoffice-write.c (gnm_xml_out_add_hex_color): use the 
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 4587709..c9d76ed 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -989,7 +989,7 @@ oo_col_start (GsfXMLIn *xin, xmlChar const **attrs)
 	if (col_info != NULL) {
 		if (state->default_style.columns == NULL && repeat_count > max_cols/2) {
 			int const last = state->pos.eval.col + repeat_count;
-			state->default_style.columns = g_memdup (col_info, sizeof (col_info));
+			state->default_style.columns = g_memdup (col_info, sizeof (*col_info));
 			state->default_style.columns->count = repeat_count;
 			sheet_col_set_default_size_pts (state->pos.sheet,
 							state->default_style.columns->size_pts);
@@ -1097,7 +1097,7 @@ oo_row_start (GsfXMLIn *xin, xmlChar const **attrs)
 	if (row_info != NULL) {
 		if (state->default_style.rows == NULL && repeat_count > max_rows/2) {
 			int const last = state->pos.eval.row + repeat_count;
-			state->default_style.rows = g_memdup (row_info, sizeof (row_info));
+			state->default_style.rows = g_memdup (row_info, sizeof (*row_info));
 			state->default_style.rows->count = repeat_count;
 			sheet_row_set_default_size_pts (state->pos.sheet,
 							state->default_style.rows->size_pts);



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