[gnumeric] xml: protects a bit against bogus value types.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] xml: protects a bit against bogus value types.
- Date: Thu, 5 Aug 2010 18:08:26 +0000 (UTC)
commit b0e9137f084e561c957d7b1dd4a78b2a67667b99
Author: Morten Welinder <terra gnome org>
Date: Thu Aug 5 14:08:04 2010 -0400
xml: protects a bit against bogus value types.
src/xml-sax-read.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/xml-sax-read.c b/src/xml-sax-read.c
index 0ff0085..7d0e9e5 100644
--- a/src/xml-sax-read.c
+++ b/src/xml-sax-read.c
@@ -2065,14 +2065,20 @@ xml_sax_cell_content (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
if (dummy)
gnm_expr_top_unref (dummy);
} else if (is_new_cell) {
+ GnmValue *v;
+
/*
* Only set to empty if this is a new cell.
* If it was created by a previous array
* we do not want to erase it.
*/
- gnm_cell_set_value (cell,
- value_new_from_string (value_type, "",
- NULL, FALSE));
+ v = value_new_from_string (value_type, "", NULL, FALSE);
+ if (!v) {
+ xml_sax_barf (G_STRFUNC, "v != NULL");
+ v = value_new_empty ();
+ }
+
+ gnm_cell_set_value (cell, v);
}
go_format_unref (value_fmt);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]