[Goodies-commits] r5712 - in xfce4-dict/trunk: . lib
Enrico Troeger
enrico at xfce.org
Sun Oct 19 19:26:03 CEST 2008
Author: enrico
Date: 2008-10-19 17:26:02 +0000 (Sun, 19 Oct 2008)
New Revision: 5712
Modified:
xfce4-dict/trunk/ChangeLog
xfce4-dict/trunk/lib/dictd.c
Log:
Fix a segfault in link parsing caused by malformed dictionary texts.
Modified: xfce4-dict/trunk/ChangeLog
===================================================================
--- xfce4-dict/trunk/ChangeLog 2008-10-19 13:47:25 UTC (rev 5711)
+++ xfce4-dict/trunk/ChangeLog 2008-10-19 17:26:02 UTC (rev 5712)
@@ -1,3 +1,8 @@
+2008-10-19 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
+
+ * Fix a segfault in link parsing caused by malformed dictionary texts.
+
+
2008-10-18 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* Use a SexyIconEntry for the search field, it's just sexy :).
Modified: xfce4-dict/trunk/lib/dictd.c
===================================================================
--- xfce4-dict/trunk/lib/dictd.c 2008-10-19 13:47:25 UTC (rev 5711)
+++ xfce4-dict/trunk/lib/dictd.c 2008-10-19 17:26:02 UTC (rev 5712)
@@ -151,6 +151,13 @@
g_string_erase(buffer, 0, len); /* remove already added text */
end = strchr(buffer->str, '}');
+ if (start > end)
+ {
+ /* braces don't match, skip this part, e.g. 'fd-deu-eng' returns
+ * ' frozen}; to be cold; to freeze {froze' */
+ gtk_text_buffer_insert(dd->main_textbuffer, &dd->textiter, "{", 1);
+ continue;
+ }
len = end - buffer->str; /* length of the link */
found_link = g_strndup(buffer->str, len);
More information about the Goodies-commits
mailing list