shithub: vdir

Download patch

ref: eae1da826473f9037346fd6c1128b21d90bc1c96
parent: 44b4aa6bb76c02046757760dd2c90d06daacc3db
author: telephil9 <[email protected]>
date: Fri Apr 17 01:30:13 EDT 2020

Fix cd() not setting 0 at end of buffer!

--- a/vdir.c
+++ b/vdir.c
@@ -116,7 +116,7 @@
 void
 cd(char *dir)
 {
-	char newpath[256];
+	char newpath[256] = {0};
 	char *sep;
 	int n;
 
@@ -133,6 +133,7 @@
 		return;
 	}
 	strncpy(path, newpath, n);
+	path[n] = 0;
 	loaddirs();
 }