Skip to content

Commit a6e0caa

Browse files
jhovoldgregkh
authored andcommitted
dib0700: fix NULL-deref at probe
commit d5823511c0f8719a39e72ede1bce65411ac653b7 upstream. Make sure to check the number of endpoints to avoid dereferencing a NULL-pointer should a malicious device lack endpoints. Fixes: c4018fa ("[media] dib0700: fix RC support on Hauppauge Nova-TD") Cc: Mauro Carvalho Chehab <mchehab@kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a896652 commit a6e0caa

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/media/usb/dvb-usb/dib0700_core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,9 @@ int dib0700_rc_setup(struct dvb_usb_device *d, struct usb_interface *intf)
783783

784784
/* Starting in firmware 1.20, the RC info is provided on a bulk pipe */
785785

786+
if (intf->altsetting[0].desc.bNumEndpoints < rc_ep + 1)
787+
return -ENODEV;
788+
786789
purb = usb_alloc_urb(0, GFP_KERNEL);
787790
if (purb == NULL) {
788791
err("rc usb alloc urb failed");

0 commit comments

Comments
 (0)