mirror of
https://github.com/apache/nuttx.git
synced 2026-03-24 15:45:48 +08:00
drivers/usbdev/pl2303.c: Don't let maximum number of bytes in request exceed CONFIG_PL2303_BULKIN_REQLEN
The request length may not exceed CONFIG_PL2303_BULKIN_REQLEN, otherwise buffer overflow will occur Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
This commit is contained in:
committed by
Xiang Xiao
parent
18526d78eb
commit
5d4d2cbbc8
@@ -636,7 +636,7 @@ static int usbclass_sndpacket(FAR struct pl2303_dev_s *priv)
|
||||
|
||||
/* Get the maximum number of bytes that will fit into one bulk IN request */
|
||||
|
||||
reqlen = MAX(CONFIG_PL2303_BULKIN_REQLEN, ep->maxpacket);
|
||||
reqlen = MIN(CONFIG_PL2303_BULKIN_REQLEN, ep->maxpacket);
|
||||
|
||||
while (!sq_empty(&priv->reqlist))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user