[PATCH] sys_getdents64: warn if reclen is 0 rather than looping forever

Mike Frysinger vapier at gentoo.org
Sat Apr 19 20:28:09 UTC 2008


Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
 file.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/file.c b/file.c
index 316fde9..6388faa 100644
--- a/file.c
+++ b/file.c
@@ -2491,6 +2491,10 @@ struct tcb *tcp;
 				d->d_namlen, d->d_namlen, d->d_name);
 		}
 #endif /* SUNOS4 */
+		if (!d->d_reclen) {
+			tprintf("/* d_reclen == 0, problem here */");
+			break;
+		}
 		i += d->d_reclen;
 		dents++;
 	}
-- 
1.5.5





More information about the Strace-devel mailing list