summaryrefslogtreecommitdiffstats
path: root/SecurityPkg
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2022-11-09 11:40:10 -0500
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-04-03 15:29:08 +0000
commitdbe820d5fa158f3bb04d2a9b335bf6e0ca0e0bb0 (patch)
treeddb73a499da133883db5959353c571c0e4780883 /SecurityPkg
parent4693b325e85c1d7e3529ab2a209405701da6f274 (diff)
downloadedk2-dbe820d5fa158f3bb04d2a9b335bf6e0ca0e0bb0.tar.gz
edk2-dbe820d5fa158f3bb04d2a9b335bf6e0ca0e0bb0.tar.bz2
edk2-dbe820d5fa158f3bb04d2a9b335bf6e0ca0e0bb0.zip
BaseTools/VfrCompile: Fix potential buffer overwrites
While more portable methods exist to handle these cases, this change does not attempt to do more than fix the immediate problem and follow the conventions already established in this code. `snprintf()` is introduced as the minimum improvement apart from making the buffers larger. Fixes the following CodeQL alerts: 1. Failure on line 2339 in BaseTools/Source/C/VfrCompile/Pccts/antlr/gen.c - Type: Potentially overrunning write - Severity: Critical - Problem: This 'call to sprintf' operation requires 17 bytes but the destination is only 16 bytes. 2. Failure on line 2341 in BaseTools/Source/C/VfrCompile/Pccts/antlr/gen.c - Type: Potentially overrunning write - Severity: Critical - Problem: This 'call to sprintf' operation requires 17 bytes but the destination is only 16 bytes. 3. Failure on line 1309 in BaseTools/Source/C/VfrCompile/Pccts/antlr/main.c - Type: Potentially overrunning write - Severity: Critical - Problem: This 'call to sprintf' operation requires 25 bytes but the destination is only 20 bytes. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
Diffstat (limited to 'SecurityPkg')
0 files changed, 0 insertions, 0 deletions