mirror of
https://github.com/moparisthebest/hexchat
synced 2024-11-24 10:12:22 -05:00
Fix possible overflow
gtk_entry_get_text_length() returns len in utf8 chars not in bytes
This commit is contained in:
parent
94ef0fd294
commit
afd2135393
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user