pidgin: 3e897249: Fixes a crash when next_begin_word is ca...

sadrul at pidgin.im sadrul at pidgin.im
Thu Jun 5 23:05:41 EDT 2008


-----------------------------------------------------------------
Revision: 3e897249d1d33c1a97f52b3ed8b32709c155d2d8
Ancestor: 9882fa5330e7a980a9ae44e056ff42572e169711
Author: sadrul at pidgin.im
Author: queueram at soc.pidgin.im
Date: 2008-06-06T03:04:05
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/3e897249d1d33c1a97f52b3ed8b32709c155d2d8

Modified files:
        finch/libgnt/gntentry.c

ChangeLog: 

Fixes a crash when next_begin_word is called on trailing spaces at the
end of an entry.

applied changes from 0b25c9dd3deaa5c16f7deff33c36af4812f2629a
             through abef8860abbb7cbebfd89a34d86d43457c0b5caf

-------------- next part --------------
============================================================
--- finch/libgnt/gntentry.c	d10788925442d949ed37c71dcfe1ea114c70c0d1
+++ finch/libgnt/gntentry.c	5a655aaeaad3f3c9a373d7ad2eb8c9411bde1f47
@@ -580,11 +580,13 @@ next_begin_word(const char *text, const 
 	while (text && text < end && g_unichar_isspace(g_utf8_get_char(text)))
 		text = g_utf8_find_next_char(text, end);
 
-	ch = g_utf8_get_char(text);
-	while ((text = g_utf8_find_next_char(text, end)) != NULL && text <= end) {
-		gunichar cur = g_utf8_get_char(text);
-		if (!SAME(ch, cur))
-			break;
+	if (text) {
+		ch = g_utf8_get_char(text);
+		while ((text = g_utf8_find_next_char(text, end)) != NULL && text <= end) {
+			gunichar cur = g_utf8_get_char(text);
+			if (!SAME(ch, cur))
+				break;
+		}
 	}
 	return (text ? text : end);
 }


More information about the Commits mailing list