Skip to content

Commit

Permalink
[REVERTME] drivers/usbdev/cdcacm.c: Set reqlen properly according to …
Browse files Browse the repository at this point in the history
…ep->maxpacket and CONFIG_CDCACM_BULKIN_REQLEN

The request length may not exceed CONFIG_CDCACM_BULKIN_REQLEN, otherwise buffer overflow will occur

This part is already changed in upstream with a slightly different patch

Signed-off-by: Jukka Laitinen <[email protected]>
  • Loading branch information
jlaitine committed Oct 3, 2024
1 parent d82c104 commit e91d380
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usbdev/cdcacm.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ static int cdcacm_sndpacket(FAR struct cdcacm_dev_s *priv)

/* Get the maximum number of bytes that will fit into one bulk IN request */

reqlen = MAX(CONFIG_CDCACM_BULKIN_REQLEN, ep->maxpacket);
reqlen = MIN(CONFIG_CDCACM_BULKIN_REQLEN, ep->maxpacket);

while (!sq_empty(&priv->txfree))
{
Expand Down

0 comments on commit e91d380

Please sign in to comment.