Commit 6e57e34
committed
Validate environment variable names in
Make sure that they're not empty and do not contain `=` signs beyond the
first character. This prevents environment variable injection, because
previously, setting the `PATH=/opt:` variable to `foobar` would lead to
the `PATH` variable being overridden.
Fixes #122335.std::process
1 parent 45a2620 commit 6e57e34
File tree
6 files changed
+113
-45
lines changed- library/std/src
- process
- sys/pal
- unix/process
- windows
6 files changed
+113
-45
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
380 | 416 | | |
381 | 417 | | |
382 | 418 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
| |||
190 | 191 | | |
191 | 192 | | |
192 | 193 | | |
| 194 | + | |
193 | 195 | | |
194 | 196 | | |
195 | 197 | | |
| |||
214 | 216 | | |
215 | 217 | | |
216 | 218 | | |
| 219 | + | |
217 | 220 | | |
218 | 221 | | |
219 | 222 | | |
| |||
276 | 279 | | |
277 | 280 | | |
278 | 281 | | |
279 | | - | |
280 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
281 | 293 | | |
282 | 294 | | |
283 | 295 | | |
| |||
358 | 370 | | |
359 | 371 | | |
360 | 372 | | |
361 | | - | |
| 373 | + | |
362 | 374 | | |
363 | 375 | | |
364 | 376 | | |
| |||
423 | 435 | | |
424 | 436 | | |
425 | 437 | | |
426 | | - | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
427 | 443 | | |
428 | 444 | | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
429 | 450 | | |
430 | 451 | | |
431 | 452 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 20 | + | |
26 | 21 | | |
27 | 22 | | |
28 | 23 | | |
| |||
37 | 32 | | |
38 | 33 | | |
39 | 34 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 35 | + | |
| 36 | + | |
45 | 37 | | |
46 | 38 | | |
47 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | | - | |
| 18 | + | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
| 62 | + | |
69 | 63 | | |
70 | 64 | | |
71 | 65 | | |
| |||
146 | 140 | | |
147 | 141 | | |
148 | 142 | | |
149 | | - | |
| 143 | + | |
150 | 144 | | |
151 | 145 | | |
152 | 146 | | |
| |||
175 | 169 | | |
176 | 170 | | |
177 | 171 | | |
178 | | - | |
179 | | - | |
| 172 | + | |
| 173 | + | |
180 | 174 | | |
181 | 175 | | |
182 | 176 | | |
| |||
219 | 213 | | |
220 | 214 | | |
221 | 215 | | |
222 | | - | |
| 216 | + | |
223 | 217 | | |
224 | 218 | | |
225 | 219 | | |
| |||
234 | 228 | | |
235 | 229 | | |
236 | 230 | | |
237 | | - | |
238 | | - | |
| 231 | + | |
| 232 | + | |
239 | 233 | | |
240 | 234 | | |
241 | 235 | | |
| |||
561 | 555 | | |
562 | 556 | | |
563 | 557 | | |
564 | | - | |
| 558 | + | |
565 | 559 | | |
566 | 560 | | |
567 | 561 | | |
| |||
729 | 723 | | |
730 | 724 | | |
731 | 725 | | |
732 | | - | |
| 726 | + | |
733 | 727 | | |
734 | 728 | | |
735 | 729 | | |
| |||
1190 | 1184 | | |
1191 | 1185 | | |
1192 | 1186 | | |
1193 | | - | |
1194 | 1187 | | |
1195 | 1188 | | |
1196 | 1189 | | |
| |||
1203 | 1196 | | |
1204 | 1197 | | |
1205 | 1198 | | |
1206 | | - | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
1207 | 1202 | | |
1208 | 1203 | | |
1209 | 1204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 24 | + | |
| 25 | + | |
30 | 26 | | |
31 | 27 | | |
32 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
150 | 176 | | |
| 177 | + | |
| 178 | + | |
151 | 179 | | |
152 | 180 | | |
153 | 181 | | |
| |||
873 | 901 | | |
874 | 902 | | |
875 | 903 | | |
876 | | - | |
| 904 | + | |
877 | 905 | | |
878 | 906 | | |
879 | 907 | | |
| |||
0 commit comments