diff options
author | Ludovic Courtès <ludo@gnu.org> | 2024-09-09 15:43:06 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2024-09-09 17:17:56 +0200 |
commit | cdb31a8869d9faf6baf561836e99d7b6953aebe3 (patch) | |
tree | 1fcaa88c803da95a1a51327bca0ce818a91e160a /gnu | |
parent | 89fdc4b45f9c147bf64eb9763172553044a7f0ab (diff) | |
download | guix-cdb31a8869d9faf6baf561836e99d7b6953aebe3.tar guix-cdb31a8869d9faf6baf561836e99d7b6953aebe3.tar.gz |
pack: Add terminating zero after ‘readlink’ call.
The bug had been there from the start (commit
47a60325ca650e8fc1a291c8655b4297f4de8deb) but only with the switch to
glibc 2.39 did we actually hit it.
* gnu/packages/aux-files/run-in-namespace.c (main): Add terminating zero
on SELF.
Change-Id: If0488f5ca0964d8d7b1666039a7f8bdf7abce111
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/packages/aux-files/run-in-namespace.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gnu/packages/aux-files/run-in-namespace.c b/gnu/packages/aux-files/run-in-namespace.c index 44c3c5a6cb..074befde46 100644 --- a/gnu/packages/aux-files/run-in-namespace.c +++ b/gnu/packages/aux-files/run-in-namespace.c @@ -652,6 +652,7 @@ main (int argc, char *argv[]) char self[PATH_MAX]; size = readlink ("/proc/self/exe", self, sizeof self - 1); assert (size > 0); + self[size] = '\0'; /* SELF is something like "/home/ludo/.local/gnu/store/…-foo/bin/ls" and we want to extract "/home/ludo/.local/gnu/store". */ |