[gnumeric] xls: don't write uninitialized memory into files.



commit 9eb927dc519ad1ba400c3b99a1985c21d5e86ee5
Author: Morten Welinder <terra gnome org>
Date:   Mon Oct 5 13:20:23 2009 -0400

    xls: don't write uninitialized memory into files.

 plugins/excel/ChangeLog  |    3 +++
 plugins/excel/ms-chart.c |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 4f5cacb..598a64b 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,5 +1,8 @@
 2009-10-05  Morten Welinder  <terra gnome org>
 
+	* ms-chart.c (chart_write_axis): Don't dump uninitialized memory
+	into file.
+
 	* ms-biff.c (ms_biff_put_len_next): Make sure we don't mix _var_
 	and _len_ calls.  Make sure we commit.
 
diff --git a/plugins/excel/ms-chart.c b/plugins/excel/ms-chart.c
index 5a0c28b..0f50832 100644
--- a/plugins/excel/ms-chart.c
+++ b/plugins/excel/ms-chart.c
@@ -4841,7 +4841,10 @@ chart_write_axis (XLChartWriteState *s, GogAxis const *axis,
 			log_scale = !strcmp (scale, "Log");
 			g_free (scale);
 		}
+
 		data = ms_biff_put_len_next (s->bp, BIFF_CHART_valuerange, 42);
+		memset (data, 0, 42);
+
 		if (log_scale)
 			flags |= 0x20;
 		if (inverted)



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