[gnumeric] Fix crash on corrupted files. [#706526]
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Fix crash on corrupted files. [#706526]
- Date: Thu, 22 Aug 2013 06:07:19 +0000 (UTC)
commit 87a2137bc3b046ed67ffe71c4323b767caa5dba9
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date: Thu Aug 22 00:05:46 2013 -0600
Fix crash on corrupted files. [#706526]
2013-08-22 Andreas J. Guelzow <aguelzow pyrshep ca>
* html_read.c (html_read_content): check for invalid UTF8
NEWS | 3 +++
plugins/html/ChangeLog | 4 ++++
plugins/html/html_read.c | 8 +++++---
3 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/NEWS b/NEWS
index 873086d..77d8c60 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
Gnumeric 1.12.6
+Andreas:
+ * Fix crash on corrupted files. [#706526]
+
Morten:
* Fix crash on corrupted files. [#706413] [#706417]
diff --git a/plugins/html/ChangeLog b/plugins/html/ChangeLog
index 1f8f418..c034cd4 100644
--- a/plugins/html/ChangeLog
+++ b/plugins/html/ChangeLog
@@ -1,3 +1,7 @@
+2013-08-22 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+ * html_read.c (html_read_content): check for invalid UTF8
+
2013-08-19 Morten Welinder <terra gnome org>
* Release 1.12.5
diff --git a/plugins/html/html_read.c b/plugins/html/html_read.c
index 7e6f9f9..8e397a7 100644
--- a/plugins/html/html_read.c
+++ b/plugins/html/html_read.c
@@ -113,9 +113,11 @@ html_read_content (htmlNodePtr cur, GString *buf, GnmStyle *mstyle,
for (ptr = cur->children; ptr != NULL ; ptr = ptr->next) {
if (ptr->type == XML_TEXT_NODE) {
- html_append_text (buf, ptr->content);
- }
- else if (ptr->type == XML_ELEMENT_NODE) {
+ if (g_utf8_validate (ptr->content, -1, NULL))
+ html_append_text (buf, ptr->content);
+ else
+ g_string_append (buf, _("[Warning: Invalid text string has been removed.]"));
+ } else if (ptr->type == XML_ELEMENT_NODE) {
if (first) {
if (xmlStrEqual (ptr->name, CC2XML ("i"))
|| xmlStrEqual (ptr->name, CC2XML ("em")))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]