--- a/readfile.c
+++ b/readfile.c
@@ -533,6 +533,12 @@
 		/* Success! Set pointers appropriately */
 		newk->kdrill_index=nextindex;
 		translations[nextindex++] = newk;
+
+                if (nextindex >= MAXTRANSLATIONSALLOWED) {
+                    fprintf(stderr, "Too many entries in the edict file. Some entries were not read.");
+                    break;
+                }
+
 		if(lastk != NULL)
 		{
 			lastk->nextk = newk;
