1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-16 03:18:09 +00:00

fix out-of-bounds read (for debug_link)

Pinmatrix should always be null-terminated for debug-link.
The memset overwrote the terminating nul character.
This commit is contained in:
Jochen Hoenicke 2018-03-23 17:19:30 +01:00 committed by Pavol Rusnak
parent c4e1c5953e
commit a7158f39a5

View File

@ -69,7 +69,7 @@ void pinmatrix_done(char *pin)
} }
i++; i++;
} }
memset(pinmatrix_perm, 'X', sizeof(pinmatrix_perm)); memset(pinmatrix_perm, 'X', sizeof(pinmatrix_perm) - 1);
} }
#if DEBUG_LINK #if DEBUG_LINK