From c1540afe77eb89dd18a8060d8dcbeccbbe368850 Mon Sep 17 00:00:00 2001 From: Tom Thorogood Date: Fri, 12 Mar 2021 20:08:19 +1030 Subject: [PATCH] Fix compilation warnings Ths call to nanosleep was missing it's header and the length calculation in parse_cred_mgmt_subcommandparams could be wrong when compiled for 64-bit targets. Both of these showed up as compiler warnings. --- fido2/ctap_parse.c | 2 +- pc/device.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/fido2/ctap_parse.c b/fido2/ctap_parse.c index 5e3510a..561f755 100644 --- a/fido2/ctap_parse.c +++ b/fido2/ctap_parse.c @@ -1064,7 +1064,7 @@ static uint8_t parse_cred_mgmt_subcommandparams(CborValue * val, CTAP_credMgmt * const uint8_t * end_byte = cbor_value_get_next_byte(&map); - uint32_t length = (uint32_t)end_byte - (uint32_t)start_byte; + uint32_t length = (uint32_t)(end_byte - start_byte); if (length > sizeof(CM->hashed.subCommandParamsCborCopy)) { return CTAP2_ERR_LIMIT_EXCEEDED; diff --git a/pc/device.c b/pc/device.c index 0536bb2..5c9b4ac 100644 --- a/pc/device.c +++ b/pc/device.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "device.h" #include "cbor.h"