Skip to content

Commit cc66549

Browse files
committed
Fix auxv location calculation
In the non-login-shell case, it was leaving a word of uninitialized memory at `envp[i] + 1`. This reuses the previous calculation based on `envp`.
1 parent ab96e08 commit cc66549

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ape/ape-m1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ int main(int argc, char **argv, char **envp) {
993993

994994
argv = (char **)(sp2 + 1);
995995
envp = (char **)(sp2 + 1 + argc + 1);
996-
auxv = sp2 + (auxv - sp) + 1;
996+
auxv = (long *)(envp + i + 1);
997997
sp = sp2;
998998

999999
/* interpret command line arguments */

0 commit comments

Comments
 (0)