diff -up tcp_wrappers_7.6/misc.c.xgets tcp_wrappers_7.6/misc.c --- tcp_wrappers_7.6/misc.c.xgets 2011-08-15 05:50:26.403091995 -0400 +++ tcp_wrappers_7.6/misc.c 2011-08-15 05:51:02.289091985 -0400 @@ -35,7 +35,7 @@ FILE *fp; int got; char *start = ptr; - while (fgets(ptr, len, fp)) { + while (len && fgets(ptr, len, fp)) { got = strlen(ptr); if (got >= 1 && ptr[got - 1] == '\n') { tcpd_context.line++;