Repository navigation
Commit 909d5eb
Validate NUL-termination of flexible-array Buffer in interop messages (#40402)
* Validate NUL-termination of flexible-array Buffer in interop messages
Use string::FromMessageBuffer<T>() instead of directly accessing the
Buffer[] flexible-array member in interop message structs. FromMessageBuffer
validates that a NUL terminator exists within the span bounds, preventing
out-of-bounds reads when a malformed message contains no Buffer data or
lacks NUL termination.
Affected message handlers:
- LxInitMessageQueryEnvironmentVariable (config.cpp)
- LxInitMessageCreateLoginSession (config.cpp)
- LxMiniInitMessageUnmount (main.cpp)
Co-authored-by: Copilot <[email protected]>
* Remove unused Message parameter name in WSLC_UNMOUNT handler
After switching to FromMessageBuffer, the Message parameter is no longer
referenced directly. Remove the name to avoid -Wunused-parameter.
Co-authored-by: Copilot <[email protected]>
---------
Co-authored-by: Ben Hillis <[email protected]>
Co-authored-by: Copilot <[email protected]>1 parent 73e63e4 commit 909d5eb
3 files changed
Lines changed: 8 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
670 | 670 | | |
671 | 671 | | |
672 | 672 | | |
673 | | - | |
674 | | - | |
| 673 | + | |
675 | 674 | | |
676 | | - | |
| 675 | + | |
| 676 | + | |
677 | 677 | | |
678 | 678 | | |
679 | | - | |
| 679 | + | |
680 | 680 | | |
681 | 681 | | |
682 | 682 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
397 | | - | |
| 397 | + | |
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
430 | | - | |
| 430 | + | |
| 431 | + | |
431 | 432 | | |
432 | 433 | | |
433 | 434 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2925 | 2925 | | |
2926 | 2926 | | |
2927 | 2927 | | |
2928 | | - | |
| 2928 | + | |
2929 | 2929 | | |
2930 | 2930 | | |
2931 | 2931 | | |
| |||
0 commit comments