nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] [PATCH 1/3] do_lockfile: make sure that lockprog and lockus


From: Kamil Dudka
Subject: [Nano-devel] [PATCH 1/3] do_lockfile: make sure that lockprog and lockuser are terminated
Date: Tue, 27 Jan 2015 17:46:46 +0100

strncpy() does not guarantee that on its own!
---
 trunk/nano/src/files.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/trunk/nano/src/files.c b/trunk/nano/src/files.c
index 90c6b0c..cbe46ae 100644
--- a/trunk/nano/src/files.c
+++ b/trunk/nano/src/files.c
@@ -253,7 +253,7 @@ int do_lockfile(const char *filename)
                + strlen(locking_suffix) + 3;
     char *lockfilename = charalloc(lockfilesize);
     char *lockfiledir = NULL;
-    char lockprog[12], lockuser[16];
+    static char lockprog[11], lockuser[17];
     struct stat fileinfo;
     int lockfd, lockpid;
 
-- 
2.1.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]