Commit ea043cab authored by Bastien Nocera's avatar Bastien Nocera

GtkEntry: Sanity check the end_pos value in _get_display_text()

parent 32825a66
......@@ -2901,7 +2901,7 @@ _gtk_entry_get_display_text (GtkEntry *entry,
text = gtk_entry_buffer_get_text (get_buffer (entry));
length = gtk_entry_buffer_get_length (get_buffer (entry));
if (end_pos < 0)
if (end_pos < 0 || end_pos > length)
end_pos = length;
if (start_pos > length)
start_pos = length;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment