summaryrefslogtreecommitdiff
path: root/gtk/gtkentry.c
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2013-03-06 15:47:43 +0100
committerBastien Nocera <hadess@hadess.net>2013-03-06 15:50:31 +0100
commitea043cab5718304d9b6170afa2d3f959fc99c718 (patch)
tree02d03c7100a40fe5fa95d37133f74df04ade44a8 /gtk/gtkentry.c
parent32825a66ac8e65bf98cafed26a339fa1f31eddd4 (diff)
downloadgtk+-ea043cab5718304d9b6170afa2d3f959fc99c718.tar.gz
GtkEntry: Sanity check the end_pos value in _get_display_text()
Diffstat (limited to 'gtk/gtkentry.c')
-rw-r--r--gtk/gtkentry.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 159120473c..e3553cc6ca 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -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;