From: Stefan Berger Date: Mon, 30 Nov 2015 16:14:18 +0000 (-0500) Subject: tpm: Check length parameter of the array X-Git-Tag: rel-1.10.0~138 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=4cdbc4105499f9ec872fff929e9ab5296b294903;p=seabios.git tpm: Check length parameter of the array 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 --- diff --git a/src/tcgbios.c b/src/tcgbios.c index c17d80d..285723c 100644 --- a/src/tcgbios.c +++ b/src/tcgbios.c @@ -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)";