From 9f77fc3dd2394373e1be753952b00dafa1a9b7da Mon Sep 17 00:00:00 2001 From: akallabeth Date: Wed, 29 Apr 2020 15:49:52 +0200 Subject: [PATCH] Fixed int overflow in msusb_mspipes_read Thanks to hac425 --- channels/urbdrc/common/msusb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels/urbdrc/common/msusb.c b/channels/urbdrc/common/msusb.c index ad2f0693e..bb517ce5d 100644 --- a/channels/urbdrc/common/msusb.c +++ b/channels/urbdrc/common/msusb.c @@ -64,7 +64,7 @@ static MSUSB_PIPE_DESCRIPTOR** msusb_mspipes_read(wStream* s, UINT32 NumberOfPip UINT32 pnum; MSUSB_PIPE_DESCRIPTOR** MsPipes; - if (Stream_GetRemainingCapacity(s) < 12 * NumberOfPipes) + if (Stream_GetRemainingCapacity(s) / 12 < NumberOfPipes) return NULL; MsPipes = (MSUSB_PIPE_DESCRIPTOR**)calloc(NumberOfPipes, sizeof(MSUSB_PIPE_DESCRIPTOR*));