View Issue Details

IDProjectCategoryView StatusLast Update
0008595ScribusLanguage Toolspublic2010-01-02 23:40
Reportersharkcz Assigned Tojghali  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version1.3.5 
Fixed in Version1.3.3.14svn 
Summary0008595: crash when freeing non-existent hyphenator
DescriptionThe problem is in my opinion in the destructor of the Hyphenator class. It calls the hnj_hyphen_free() function unconditionally, but from my understanding of the code it's legal to have a NULL value in the hdict attribute and useAble will be false. Patch is attached.

reference:
https://bugzilla.redhat.com/show_bug.cgi?id=537677
TagsNo tags attached.
Patch

Activities

2009-11-23 09:18

 

0001-check-hdict-value-before-freeing-the-hyphenator.patch (763 bytes)   
From dedea3f94802f0f9d9adef4c48f8061282baf776 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Mon, 23 Nov 2009 10:13:48 +0100
Subject: [PATCH] check hdict value before freeing the hyphenator

---
 Scribus/scribus/hyphenator.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/Scribus/scribus/hyphenator.cpp b/Scribus/scribus/hyphenator.cpp
index 614db47..4da4467 100644
--- a/Scribus/scribus/hyphenator.cpp
+++ b/Scribus/scribus/hyphenator.cpp
@@ -90,7 +90,8 @@ Hyphenator::Hyphenator(QWidget* parent, ScribusDoc *dok) : QObject( parent ),
 
 Hyphenator::~Hyphenator()
 {
-	hnj_hyphen_free(hdict);
+	if (hdict)
+		hnj_hyphen_free(hdict);
 }
 
 void Hyphenator::NewDict(const QString& name)
-- 
1.6.3.3

jghali

2009-11-23 20:55

administrator   ~0022878

Thanks! Patch applied down to 1.3.3.14svn!

Issue History

Date Modified Username Field Change
2009-11-23 09:18 sharkcz New Issue
2009-11-23 09:18 sharkcz File Added: 0001-check-hdict-value-before-freeing-the-hyphenator.patch
2009-11-23 20:55 jghali Note Added: 0022878
2009-11-23 20:55 jghali Status new => resolved
2009-11-23 20:55 jghali Fixed in Version => 1.3.3.14svn
2009-11-23 20:55 jghali Resolution open => fixed
2009-11-23 20:55 jghali Assigned To => jghali
2010-01-02 23:40 cbradney Status resolved => closed