| Summary: | [PATCH] Only copy basic Windows environment | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Corinna Vinschen <vinschen> | ||||||
| Component: | sshd | Assignee: | OpenSSH Bugzilla mailing list <openssh-bugs> | ||||||
| Status: | CLOSED FIXED | ||||||||
| Severity: | security | ||||||||
| Priority: | P2 | ||||||||
| Version: | -current | ||||||||
| Hardware: | ix86 | ||||||||
| OS: | Cygwin on NT/2k/Win7-11 | ||||||||
| Attachments: |
|
||||||||
|
Description
Corinna Vinschen
2004-08-18 17:38:24 AEST
Created attachment 698 [details]
The patch copies only the basic Windows environment over to child processes
Comment on attachment 698 [details] The patch copies only the basic Windows environment over to child processes Looks OK to me. A few minor comments: [...] >+ p[idx] = NULL; >+ for (e = environ; *e; ++e) { style guide says to explicitly test against NULL, ie "*e != NULL" >+ for (i = 0; i < WENV_SIZ; ++i) { >+ if (!strncmp(*e, wenv_arr[i].name, >+ wenv_arr[i].namelen)) { >+ p[idx] = *e; >+ p[++idx] = NULL; You could make that "p[idx++] = *e", move "p[idx] = NULL" from above the loop to below and delete "p[++idx] = NULL" from the loop. It would be nice if the array didn't need to be structs but that would mean a bit of run-time overhead and I don't think it would be any clearer anyway... Created attachment 706 [details]
Modified patch with Darren's suggestions
Patch #706 applied, thanks. |