aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-06-28 20:54:00 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-06-28 21:07:44 +0200
commit8dd898e7ddea3a8f2b2b1ad68571bcc77085e775 (patch)
tree2ff18b0b9fba21d451a25e792828df66fa3efd2c
parenttest/lib: remove non-sensical *Runner classes (diff)
downloadcimple-8dd898e7ddea3a8f2b2b1ad68571bcc77085e775.tar.gz
cimple-8dd898e7ddea3a8f2b2b1ad68571bcc77085e775.zip
file: readlink(2) doesn't null-terminate
Thanks, valgrind.
-rw-r--r--src/file.c1
1 files changed, 1 insertions, 0 deletions
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;
}