mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-31 05:52:55 +08:00
Fix buffer overrun at pipe_read_packet()
This commit is contained in:
parent
3e9bb3bee1
commit
7137a0a92f
@ -250,12 +250,12 @@ static void pipe_read_packet(void *buf, volatile void *fifo, unsigned len)
|
|||||||
len -= 4;
|
len -= 4;
|
||||||
}
|
}
|
||||||
if (len >= 2) {
|
if (len >= 2) {
|
||||||
*(uint32_t *)addr = reg->u16;
|
*(uint16_t *)addr = reg->u16;
|
||||||
addr += 2;
|
addr += 2;
|
||||||
len -= 2;
|
len -= 2;
|
||||||
}
|
}
|
||||||
if (len) {
|
if (len) {
|
||||||
*(uint32_t *)addr = reg->u8;
|
*(uint8_t *)addr = reg->u8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user