Skip to content

Commit 7137a0a

Browse files
committed
Fix buffer overrun at pipe_read_packet()
1 parent 3e9bb3b commit 7137a0a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/portable/mentor/musb/dcd_musb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,12 @@ static void pipe_read_packet(void *buf, volatile void *fifo, unsigned len)
250250
len -= 4;
251251
}
252252
if (len >= 2) {
253-
*(uint32_t *)addr = reg->u16;
253+
*(uint16_t *)addr = reg->u16;
254254
addr += 2;
255255
len -= 2;
256256
}
257257
if (len) {
258-
*(uint32_t *)addr = reg->u8;
258+
*(uint8_t *)addr = reg->u8;
259259
}
260260
}
261261

0 commit comments

Comments
 (0)