mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-07 18:30:28 +00:00
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:
parent
ab96e08a65
commit
cc6654956a
1 changed files with 1 additions and 1 deletions
|
@ -993,7 +993,7 @@ int main(int argc, char **argv, char **envp) {
|
||||||
|
|
||||||
argv = (char **)(sp2 + 1);
|
argv = (char **)(sp2 + 1);
|
||||||
envp = (char **)(sp2 + 1 + argc + 1);
|
envp = (char **)(sp2 + 1 + argc + 1);
|
||||||
auxv = sp2 + (auxv - sp) + 1;
|
auxv = (long *)(envp + i + 1);
|
||||||
sp = sp2;
|
sp = sp2;
|
||||||
|
|
||||||
/* interpret command line arguments */
|
/* interpret command line arguments */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue