--- a/ielister.cpp
+++ b/ielister.cpp
@@ -393,7 +393,10 @@
 int OutStream::AddDword(char *label)
 {
 	unsigned int tmpdword;
-	read(fhandle, &tmpdword, 4);
+	if (read(fhandle, &tmpdword, 4)!=4)
+  {
+    return 0;
+  }
 	DrawIndent();
 #ifdef WIN32
 	if(outoffset+hexnumsize+OTHERSIZE+DWORDSIZE>=buffsize)
@@ -412,7 +415,10 @@
 int OutStream::AddWord(char *label)
 {
 	unsigned short tmpword;
-	read(fhandle, &tmpword, 2);
+	if (read(fhandle, &tmpword, 2)!=2)
+  {
+    return 0;
+  }
 	DrawIndent();
 #ifdef WIN32
 	if(outoffset+hexnumsize+OTHERSIZE+WORDSIZE>=buffsize)