From 1d402f5fbbfd74be8369765ed8b4d8f664ba4996 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Sat, 27 Feb 2021 20:31:00 +0100 Subject: nq: check d_name fits into newestlocked (our filenames always will) --- nq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- cgit 1.4.1