From afd2135393c4c4f759054bbadfce7accbef4e927 Mon Sep 17 00:00:00 2001 From: TingPing Date: Thu, 4 Jun 2015 04:02:33 -0400 Subject: [PATCH] Fix possible overflow gtk_entry_get_text_length() returns len in utf8 chars not in bytes --- src/fe-gtk/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fe-gtk/setup.c b/src/fe-gtk/setup.c index 11261560..dc469591 100644 --- a/src/fe-gtk/setup.c +++ b/src/fe-gtk/setup.c @@ -1169,8 +1169,8 @@ setup_entry_cb (GtkEntry *entry, setting *set) { int size; int pos; - int len = gtk_entry_get_text_length (entry); unsigned char *p = (unsigned char*)gtk_entry_get_text (entry); + int len = strlen (p); /* need to truncate? */ if (len >= set->extra)