Skip to content
This repository has been archived by the owner on Feb 10, 2024. It is now read-only.

Commit

Permalink
Fix possible overflow
Browse files Browse the repository at this point in the history
gtk_entry_get_text_length() returns len in utf8
chars not in bytes
  • Loading branch information
TingPing committed Jun 4, 2015
1 parent 94ef0fd commit afd2135
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fe-gtk/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit afd2135

Please sign in to comment.