mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-05-02 06:06:24 -04:00
fw: Add destination buffer size to read()
Signed-off-by: Daniel Lublin <daniel@lublin.se>
This commit is contained in:
parent
b292c72534
commit
f386cec1ed
3 changed files with 13 additions and 3 deletions
|
@ -244,7 +244,11 @@ int main()
|
|||
|
||||
memset(cmd, 0, CMDLEN_MAXBYTES);
|
||||
// Now we know the size of the cmd frame, read it all
|
||||
read(cmd, hdr.len);
|
||||
if (read(cmd, CMDLEN_MAXBYTES, hdr.len) != 0) {
|
||||
htif_puts("read: buffer overrun\n");
|
||||
forever_redflash();
|
||||
// Not reached
|
||||
}
|
||||
|
||||
// Is it for us?
|
||||
if (hdr.endpoint != DST_FW) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue