mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
pack: Add terminating zero after ‘readlink’ call.
The bug had been there from the start (commit
47a60325ca
) 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
This commit is contained in:
parent
89fdc4b45f
commit
cdb31a8869
1 changed files with 1 additions and 0 deletions
|
@ -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". */
|
||||
|
|
Loading…
Reference in a new issue