Fix to resolve possible buffer overflow with atmel_get_rev_info when using byte.

This commit is contained in:
David Garske 2018-09-28 11:33:42 -07:00
parent 177bf49fa6
commit bd57f5b385
2 changed files with 3 additions and 3 deletions

View File

@ -308,7 +308,7 @@ static int atmel_init_enc_key(void)
return ret;
}
int atmel_get_rev_info(byte* revision)
int atmel_get_rev_info(word32* revision)
{
int ret;
ret = atcab_info((uint8_t*)revision);
@ -319,7 +319,7 @@ int atmel_get_rev_info(byte* revision)
void atmel_show_rev_info(void)
{
#ifdef WOLFSSL_ATECC508A_DEBUG
byte revision = 0;
word32 revision = 0;
atmel_get_rev_info(&revision);
printf("ATECC508A Revision: %x\n", (word32)revision);
#endif

View File

@ -94,7 +94,7 @@ int atmel_set_slot_allocator(atmel_slot_alloc_cb alloc,
atmel_slot_dealloc_cb dealloc);
int atmel_ecc_translate_err(int status);
int atmel_get_rev_info(byte* revision);
int atmel_get_rev_info(word32* revision);
void atmel_show_rev_info(void);
/* The macro ATECC_GET_ENC_KEY can be set to override the default