]> Pileus Git - ~andy/gtk/commitdiff
GtkEntry: Sanity check the end_pos value in _get_display_text()
authorBastien Nocera <hadess@hadess.net>
Wed, 6 Mar 2013 14:47:43 +0000 (15:47 +0100)
committerBastien Nocera <hadess@hadess.net>
Wed, 6 Mar 2013 14:50:31 +0000 (15:50 +0100)
gtk/gtkentry.c

index 159120473c8a323d598478645894c51c5ee1e856..e3553cc6ca3b085646be8c912a4b6a29dc33a80e 100644 (file)
@@ -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;