Skip to content

Commit

Permalink
Merge pull request #1227 from kkitayam/fix_dcd_musb_buffer_overrun
Browse files Browse the repository at this point in the history
Fix buffer overrun in dcd_musb driver
  • Loading branch information
hathach authored Dec 5, 2021
2 parents 3e9bb3b + 7137a0a commit f8288be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/portable/mentor/musb/dcd_musb.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,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;
}
}

Expand Down

0 comments on commit f8288be

Please sign in to comment.