]> xenbits.xensource.com Git - seabios.git/commitdiff
tpm: Check length parameter of the array
authorStefan Berger <stefanb@linux.vnet.ibm.com>
Mon, 30 Nov 2015 16:14:18 +0000 (11:14 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Sun, 20 Dec 2015 19:36:15 +0000 (14:36 -0500)
Check the length parameter that indicates the length of the array
for whether it has a minimum value of 0x200.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
src/tcgbios.c

index c17d80dba653555d868da4c2ee0695b238d512a6..285723c8682040534b7e4f87b74bb3a2e379f4a3 100644 (file)
@@ -766,6 +766,9 @@ tpm_add_bcv(u32 bootdrv, const u8 *addr, u32 length)
     if (!has_working_tpm())
         return TCG_GENERAL_ERROR;
 
+    if (length < 0x200)
+        return TCG_INVALID_INPUT_PARA;
+
     const char *string = "Booting BCV device 00h (Floppy)";
     if (bootdrv == 0x80)
         string = "Booting BCV device 80h (HDD)";