repair possible DOS in xgets

This commit is contained in:
JFCH 2011-08-15 05:58:45 -04:00
parent 0477bdfa37
commit 2a8f5527b2
1 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,12 @@
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++;