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:
parent
18526d78eb
commit
5d4d2cbbc8
1 changed files with 1 additions and 1 deletions
|
@ -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))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue