Commit 0e58128
BaseTools/VfrCompile: Fix memory issues
Using GCC 13.3.0 discovers an out of bounds memory access in VfrCompile
when building DriverSampleDxe. This is also discoverable with ASan.
The issue here is that EFI_IFR_TYPE_VALUE is a flexible type and
when passed by value for string types only the header part is accessible.
Assuming the remainder is zero seems to be ok as gZeroEfiIfrTypeValue
is used as a variable source.
This change also fixes a warning for new[]/delete[] mismatch
discovered by ASan.
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>1 parent 9e8d89f commit 0e58128
1 file changed
+7
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
83 | 89 | | |
84 | 90 | | |
85 | 91 | | |
| |||
2380 | 2386 | | |
2381 | 2387 | | |
2382 | 2388 | | |
2383 | | - | |
| 2389 | + | |
2384 | 2390 | | |
2385 | 2391 | | |
2386 | 2392 | | |
| |||
0 commit comments