diff -ruN newt-0.52.2-old/checkboxtree.c newt-0.52.2/checkboxtree.c
--- newt-0.52.2-old/checkboxtree.c	2006-01-19 21:37:14.000000000 +0000
+++ newt-0.52.2/checkboxtree.c	2006-01-19 21:37:29.000000000 +0000
@@ -537,6 +537,18 @@
     free(co);
 }
 
+static void ctEnsureLimits( struct CheckboxTree *ct ) {
+    struct items **listEnd = ct->flatList + ct->flatCount - 1;
+    if (ct->firstItem < ct->flatList)
+        ct->firstItem = ct->flatList;
+    if (ct->currItem < ct->flatList)
+        ct->currItem = ct->flatList;
+    if (ct->firstItem > listEnd) {
+        ct->firstItem = listEnd;
+        ct->currItem = listEnd;
+    }
+}
+
 struct eventResult ctEvent(newtComponent co, struct event ev) {
     struct CheckboxTree * ct = co->data;
     struct eventResult er;
@@ -648,6 +660,7 @@
 		ct->currItem -= co->height;
 		ct->firstItem -= co->height;
 	    }
+	    ctEnsureLimits( ct );
 
 	    ctDraw(co);
 	    if(co->callback) co->callback(co, co->callbackData);
@@ -664,6 +677,7 @@
 	    	ct->currItem += co->height;
 		ct->firstItem += co->height;
 	    }
+	    ctEnsureLimits( ct );
 
 	    ctDraw(co);
 	    if(co->callback) co->callback(co, co->callbackData);
