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`.
This commit is contained in:
Jōshin 2023-12-03 21:59:20 -05:00
parent ab96e08a65
commit cc6654956a
No known key found for this signature in database

View file

@ -993,7 +993,7 @@ int main(int argc, char **argv, char **envp) {
argv = (char **)(sp2 + 1);
envp = (char **)(sp2 + 1 + argc + 1);
auxv = sp2 + (auxv - sp) + 1;
auxv = (long *)(envp + i + 1);
sp = sp2;
/* interpret command line arguments */