--- /homenfs/ikm/tmp/gtkentry_2_24.c	2016-10-04 13:57:43.000000000 +1100
+++ gtkentry.c	2016-10-04 16:29:42.000000000 +1100
@@ -5224,6 +5224,7 @@
   GtkEditable *editable = GTK_EDITABLE (entry);
   gint tmp_pos;
   gboolean old_need_im_reset;
+  guint text_length;
 
   old_need_im_reset = entry->need_im_reset;
   entry->need_im_reset = FALSE;
@@ -5232,8 +5233,11 @@
     gtk_editable_delete_selection (editable);
   else
     {
-      if (entry->overwrite_mode)
-        gtk_entry_delete_from_cursor (entry, GTK_DELETE_CHARS, 1);
+      if (entry->overwrite_mode) {
+        text_length = gtk_entry_buffer_get_length (get_buffer (entry));
+        if (entry->current_pos < text_length)
+          gtk_entry_delete_from_cursor (entry, GTK_DELETE_CHARS, 1);
+      }
     }
 
   tmp_pos = entry->current_pos;
