diff options
author | TingPing <tingping@tingping.se> | 2015-06-04 04:02:33 -0400 |
---|---|---|
committer | TingPing <tingping@tingping.se> | 2015-06-04 04:02:33 -0400 |
commit | afd2135393c4c4f759054bbadfce7accbef4e927 (patch) | |
tree | acf4206b624fd73ca52a28972726874a751e6c10 /src | |
parent | 94ef0fd29480b8390b0adff625122db9e732ac5a (diff) |
Fix possible overflow
gtk_entry_get_text_length() returns len in utf8 chars not in bytes
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-gtk/setup.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) |