From d259b4aba2696a1996f837e1d7d58f9b13ba91d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C5=8Dshin?= Date: Mon, 6 May 2024 16:34:58 -0700 Subject: [PATCH] Zero out end-of-auxv MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I haven’t actually thought extremely carefully about exactly which value gets zeroed by the previously-mentioned loop, but it varies by one word, so it’s wrong half the time. --- ape/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ape/loader.c b/ape/loader.c index d74f83fe0..21f615577 100644 --- a/ape/loader.c +++ b/ape/loader.c @@ -1069,7 +1069,7 @@ EXTERN_C __attribute__((__noreturn__)) void ApeLoader(long di, long *sp, flags = (endp - 1) - sp + sp2; flags[0] = AT_FLAGS; flags[1] = literally * AT_FLAGS_PRESERVE_ARGV0; - /* end-of-auxv sentinel is zeroed by loop above */ + flags[2] = 0; /* end-of-auxv sentinel */ } sp = sp2;