summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkkitayam <[email protected]>2021-12-04 01:18:42 +0900
committerkkitayam <[email protected]>2021-12-04 01:18:42 +0900
commit81285273a6b5cacace52e74890ff9863a6a92d1a (patch)
treec8bf63e68355326c7b7f0aa8ce994615d592e544 /src
parent6ecd93eb6051b22c5475a66dc992b5aac0fac96e (diff)
Fix memory overrun at pipe_read_packet()
Diffstat (limited to 'src')
-rw-r--r--src/portable/mentor/musb/hcd_musb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/portable/mentor/musb/hcd_musb.c b/src/portable/mentor/musb/hcd_musb.c
index dc614d074..acccb7674 100644
--- a/src/portable/mentor/musb/hcd_musb.c
+++ b/src/portable/mentor/musb/hcd_musb.c
@@ -269,12 +269,12 @@ static void pipe_read_packet(void *buf, volatile void *fifo, unsigned len)
len -= 4;
}
if (len >= 2) {
- *(uint32_t *)addr = reg->u16;
+ *(uint16_t *)addr = reg->u16;
addr += 2;
len -= 2;
}
if (len) {
- *(uint32_t *)addr = reg->u8;
+ *(uint8_t *)addr = reg->u8;
}
}