summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorRichardHitt <rbh00@netcom.com>2014-07-19 15:51:06 -0400
committerTingPing <tingping@fedoraproject.org>2014-07-19 15:51:06 -0400
commit0d3706e2ee26d40e8a3996dcc19810635f25b3cd (patch)
treee93edf3769ce733007a8488efc11b51738da125b /src
parent3c584e2cd5efbd8db14c317c1524efd553dcde69 (diff)
Fix possible crash in spell check
Closes #1048
Diffstat (limited to 'src')
-rw-r--r--src/fe-gtk/sexy-spell-entry.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/fe-gtk/sexy-spell-entry.c b/src/fe-gtk/sexy-spell-entry.c
index c2c2a4db..119acca4 100644
--- a/src/fe-gtk/sexy-spell-entry.c
+++ b/src/fe-gtk/sexy-spell-entry.c
@@ -1134,10 +1134,15 @@ entry_strsplit_utf8(GtkEntry *entry, gchar ***set, gint **starts, gint **ends)
 			gchar *start;
 
 			/* Find the end of this string */
-			cend = i;
-			while ((!log_attrs[cend].is_word_end || !log_attrs[cend].is_word_boundary)
-					&& !log_attrs[cend].is_white)
-				cend++;
+			for (cend = i; cend < n_attrs; cend++)
+			{
+				PangoLogAttr a = log_attrs[cend];
+
+				if (a.is_white)
+					break;
+				if (a.is_word_end && a.is_word_boundary)
+					break;
+			}
 
 			/* Copy sub-string */
 			start = g_utf8_offset_to_pointer(text, i);