mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] linux-2.4.19/drivers/ieee1394/video1394.c
@ 2002-08-24 12:44 silvio
  0 siblings, 0 replies; only message in thread
From: silvio @ 2002-08-24 12:44 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 156 bytes --]

avoid possible integer overflow

(also change the <= to just != since its using unsigned types anyway making
the sign test invalid here *shrug*)

--
Silvio

[-- Attachment #2: patch.video1394 --]
[-- Type: text/plain, Size: 610 bytes --]

--- linux-2.4.19/drivers/ieee1394/video1394.c	Sat Aug 24 05:37:15 2002
+++ linux-2.4.19-dev/drivers/ieee1394/video1394.c	Sat Aug 24 05:40:22 2002
@@ -871,13 +871,13 @@
 		}
 		ohci->ISO_channel_usage |= mask;
 
-		if (v.buf_size<=0) {
+		if (v.buf_size == 0 || v.buf_size > VIDEO1394_MAX_SIZE) {
 			PRINT(KERN_ERR, ohci->id,
 			      "Invalid %d length buffer requested",v.buf_size);
 			return -EFAULT;
 		}
 
-		if (v.nb_buffers<=0) {
+		if (v.nb_buffers == 0 || v.nb_buffers > VIDEO1394_MAX_SIZE) {
 			PRINT(KERN_ERR, ohci->id,
 			      "Invalid %d buffers requested",v.nb_buffers);
 			return -EFAULT;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-08-24 12:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-24 12:44 [PATCH] linux-2.4.19/drivers/ieee1394/video1394.c silvio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®