summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2021-02-27 20:31:00 +0100
committerLeah Neukirchen <leah@vuxu.org>2021-03-13 16:27:55 +0100
commit1d402f5fbbfd74be8369765ed8b4d8f664ba4996 (patch)
tree6419f6eb6ee4a5064126b4ca34b35bbc78abc600
parent9942e645b33c7d8772f7419e4b3fc8f50aa7eda8 (diff)
downloadnq-1d402f5fbbfd74be8369765ed8b4d8f664ba4996.tar.gz
nq-1d402f5fbbfd74be8369765ed8b4d8f664ba4996.tar.xz
nq-1d402f5fbbfd74be8369765ed8b4d8f664ba4996.zip
nq: check d_name fits into newestlocked (our filenames always will)
-rw-r--r--nq.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/nq.c b/nq.c
index 178626b..5fe69bf 100644
--- a/nq.c
+++ b/nq.c
@@ -309,7 +309,8 @@ again:
 			/* wait for all older ,* files than ours.  */
 
 			if (!(ent->d_name[0] == ',' &&
-			    strcmp(ent->d_name, lockfile+1) < 0))
+			    strcmp(ent->d_name, lockfile+1) < 0 &&
+			    strlen(ent->d_name) < sizeof(newestlocked)))
 				continue;
 
 			int fd = openat(dirfd, ent->d_name, O_RDWR);