[gnumeric] .gnumeric: fix crash when solver parameters in corrupted file.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] .gnumeric: fix crash when solver parameters in corrupted file.
- Date: Mon, 24 Jun 2013 19:33:44 +0000 (UTC)
commit 937df40db6b3086f11ccf3eb457ae2c90429f550
Author: Morten Welinder <terra gnome org>
Date: Mon Jun 24 15:33:18 2013 -0400
.gnumeric: fix crash when solver parameters in corrupted file.
ChangeLog | 5 +++++
NEWS | 2 +-
src/xml-sax-read.c | 9 +++++++--
3 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 46db596..2fd99fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-06-24 Morten Welinder <terra gnome org>
+
+ * src/xml-sax-read.c (xml_sax_solver_start): Ensure we have a
+ sheet. Fixes #703006.
+
2013-06-23 Andreas J. Guelzow <aguelzow pyrshep ca>
* src/gui-clipboard.c (x_clipboard_get_cb): take care of the case
diff --git a/NEWS b/NEWS
index fc6199e..8b93347 100644
--- a/NEWS
+++ b/NEWS
@@ -71,7 +71,7 @@ Morten:
* Fix xls/biff5 link export. [#701604]
* Workaround problems with automake 1.13.
* Fix crashes on corrupted files. [#702101] [#702182] [#702218]
- [#702267] [#702277] [#702379] [#702658]
+ [#702267] [#702277] [#702379] [#702658] [#703006]
* Improve xls import of new stat function names.
* Plug leaks.
diff --git a/src/xml-sax-read.c b/src/xml-sax-read.c
index fbf60ff..673dca2 100644
--- a/src/xml-sax-read.c
+++ b/src/xml-sax-read.c
@@ -2507,13 +2507,18 @@ xml_sax_solver_constr_start (GsfXMLIn *xin, xmlChar const **attrs)
static void
xml_sax_solver_start (GsfXMLIn *xin, xmlChar const **attrs)
{
- Sheet *sheet = gnm_xml_in_cur_sheet (xin);
- GnmSolverParameters *sp = sheet->solver_parameters;
+ XMLSaxParseState *state = (XMLSaxParseState *)xin->user_state;
+ Sheet *sheet;
+ GnmSolverParameters *sp;
int col = -1, row = -1;
int ptype, mtype;
GnmParsePos pp;
gboolean old = FALSE;
+ xml_sax_must_have_sheet (state);
+ sheet = gnm_xml_in_cur_sheet (xin);
+ sp = sheet->solver_parameters;
+
parse_pos_init_sheet (&pp, sheet);
for (; attrs && attrs[0] && attrs[1] ; attrs += 2) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]