vboot: Convert response_length from uint32_t to size_t in VbExTpmSendReceive

Length arguments for VbExTpmSendReceive have type uint32_t but it calls function
which expects size_t. This change converts uint32_t to size_t on call and
size_t to uint32_t on return.

BUG=None
BRANCH=None
TEST=Booted Nyan Big to Linux

Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Change-Id: I1971488baae2d060c0cddec7749461c91602a4f9
Reviewed-on: https://chromium-review.googlesource.com/198016
This commit is contained in:
Daisuke Nojiri 2014-05-02 10:36:43 -07:00 committed by chrome-internal-fetch
commit 6830747eb4

View file

@ -225,9 +225,13 @@ VbError_t VbExTpmOpen(void)
VbError_t VbExTpmSendReceive(const uint8_t *request, uint32_t request_length,
uint8_t *response, uint32_t *response_length)
{
if (gcontext->tis_sendrecv(request, request_length,
response, response_length))
size_t len = *response_length;
if (gcontext->tis_sendrecv(request, request_length, response, &len))
return VBERROR_UNKNOWN;
/* check 64->32bit overflow and (re)check response buffer overflow */
if (len > *response_length)
return VBERROR_UNKNOWN;
*response_length = len;
return VBERROR_SUCCESS;
}