diff --git a/ChangeLog b/ChangeLog index 74e735bb..7bd3095e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 2015-02-01 Kamil Dudka * src/files.c (write_lockfile): Avoid writing uninitialized bytes to the lock file -- a simple null_at() would not initialize the buffer. + * src/files.c (do_lockfile): Make sure that 'lockprog' and 'lockuser' + are terminated -- strncpy() does not guarantee that on its own. 2015-02-01 Benno Schulenberg * src/winio.c (do_credits): Add a general entry for all translators. diff --git a/src/files.c b/src/files.c index 90c6b0cc..cbe46aee 100644 --- a/src/files.c +++ b/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;