From 8dd898e7ddea3a8f2b2b1ad68571bcc77085e775 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 28 Jun 2023 20:54:00 +0200 Subject: file: readlink(2) doesn't null-terminate Thanks, valgrind. --- src/file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/file.c b/src/file.c index 5c36b77..eb7135a 100644 --- a/src/file.c +++ b/src/file.c @@ -86,6 +86,7 @@ char *my_readlink(const char *path) continue; } + buf[res] = '\0'; break; } -- cgit v1.2.3