]> git.proxmox.com Git - mirror_edk2.git/commit
BaseTools: Fix wrong type of arguments to formatting functions
authorMichael Kubacki <michael.kubacki@microsoft.com>
Tue, 8 Nov 2022 17:17:59 +0000 (12:17 -0500)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 9 Nov 2022 14:53:10 +0000 (14:53 +0000)
commit179efe5d69214ba95cdcb9dcbc5845a9f0114146
tree98080dadd02ccfe1d829b544da306975297f848c
parent0be81a4d83810cdb018d293bc264f489e7664043
BaseTools: Fix wrong type of arguments to formatting functions

Fixes issues found with the cpp/wrong-type-format-argument CodeQL
rule in BaseTools.

Reference:
https://cwe.mitre.org/data/definitions/686.html

The following CodeQL errors are resolved:

1. Check failure on line 1115 in
   BaseTools/Source/C/EfiRom/EfiRom.c

   - This argument should be of type 'int' but is of type 'char *'.
   - This argument should be of type 'int' but is of type 'signed
     char *'.

2. Check failure on line 359 in
   BaseTools/Source/C/GenFw/Elf32Convert.c

   - This argument should be of type 'CHAR8 *' but is of type
     'unsigned int'.

3. Check failure on line 1841 in
   BaseTools/Source/C/GenFw/Elf64Convert.c

   - This argument should be of type 'unsigned int' but is of type
     'unsigned long long'.

4. Check failure on line 1871 in
   BaseTools/Source/C/GenFw/Elf64Convert.c

   - This argument should be of type 'unsigned int' but is of type
     'unsigned long long'.

5. Check failure on line 2400 in
   BaseTools/Source/C/GenFv/GenFvInternalLib.c

   - This argument should be of type 'unsigned long long' but is of
     type 'unsigned int'.

6. Check failure on line 1099 in
   BaseTools/Source/C/GenFw/Elf64Convert.c

   - This argument should be of type 'CHAR8 *' but is of type
     'unsigned int'.

7. Check failure on line 1098 in
   BaseTools/Source/C/GenSec/GenSec.c

   - This argument should be of type 'CHAR8 *' but is of type
     'char **'.

8. Check failure on line 911 in
   BaseTools/Source/C/GenSec/GenSec.c

  - This argument should be of type 'CHAR8 *' but is of type
    'char **'.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Sean Brogan <sean.brogan@microsoft.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
BaseTools/Source/C/EfiRom/EfiRom.c
BaseTools/Source/C/GenFv/GenFvInternalLib.c
BaseTools/Source/C/GenFw/Elf32Convert.c
BaseTools/Source/C/GenFw/Elf64Convert.c
BaseTools/Source/C/GenSec/GenSec.c