audk/BaseTools/Source/C
Michael Kubacki dbe820d5fa 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>
2023-04-03 15:29:08 +00:00
..
BrotliCompress BaseTools: Update brotli submodule 2022-02-15 02:13:32 +00:00
Common BaseTools: Replace duplicate __PcdSet prototype with __PcdGet 2023-03-24 14:52:14 +00:00
DevicePath BaseTools: Use BUILD_CC when checking gcc version in DevicePath 2022-12-30 04:30:30 +00:00
EfiRom BaseTools: Fix wrong type of arguments to formatting functions 2022-11-09 14:53:10 +00:00
GenCrc32 BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
GenFfs BaseTools: fix gcc12 warning 2022-03-28 00:51:30 +00:00
GenFv BaseTools: remove useless dependency on libuuid 2023-02-07 03:10:41 +00:00
GenFw BaseTools: Fix wrong type of arguments to formatting functions 2022-11-09 14:53:10 +00:00
GenSec BaseTools: Fix wrong type of arguments to formatting functions 2022-11-09 14:53:10 +00:00
Include BaseTools: Add LoongArch64 binding. 2022-10-14 02:16:33 +00:00
LzmaCompress BaseTools: fix gcc12 warning 2022-03-28 00:51:30 +00:00
Makefiles BaseTools/Source/C: Use /Z7 instead of /Zi for host tools 2022-11-08 18:29:51 +00:00
PyEfiCompressor BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
TianoCompress BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
VfrCompile BaseTools/VfrCompile: Fix potential buffer overwrites 2023-04-03 15:29:08 +00:00
VolInfo BaseTools/VolInfo: Update file and section type strings 2022-10-02 05:34:38 +00:00
GNUmakefile BaseTools: Add LoongArch64 binding. 2022-10-14 02:16:33 +00:00
Makefile BaseTools: Convert Split tool to python 2021-01-21 10:19:09 +00:00