Module Name:    src
Committed By:   jakllsch
Date:           Fri Jan 24 13:20:33 UTC 2020

Modified Files:
        src/sys/lib/libsa: ext2fs.c

Log Message:
Use dp->e2d_namlen rather than strlen(dp->e2d_name) in ext2fs_ls().

Prevents garbage beyond the end of the name from appearing on screen.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/lib/libsa/ext2fs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/lib/libsa/ext2fs.c
diff -u src/sys/lib/libsa/ext2fs.c:1.28 src/sys/lib/libsa/ext2fs.c:1.29
--- src/sys/lib/libsa/ext2fs.c:1.28	Mon Jun 24 13:58:24 2019
+++ src/sys/lib/libsa/ext2fs.c	Fri Jan 24 13:20:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ext2fs.c,v 1.28 2019/06/24 13:58:24 pgoyette Exp $	*/
+/*	$NetBSD: ext2fs.c,v 1.29 2020/01/24 13:20:33 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1997 Manuel Bouyer.
@@ -866,7 +866,7 @@ ext2fs_ls(struct open_file *f, const cha
 				goto out;
 			}
 			lsadd(&names, pattern, dp->e2d_name,
-			    strlen(dp->e2d_name), fs2h32(dp->e2d_ino), t);
+			    dp->e2d_namlen, fs2h32(dp->e2d_ino), t);
 		}
 		fp->f_seekp += buf_size;
 	}

Reply via email to