All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.4] af_irda.c comparison fix
@ 2004-08-13 18:56 O.Sezer
  0 siblings, 0 replies; only message in thread
From: O.Sezer @ 2004-08-13 18:56 UTC (permalink / raw)
  To: linux-kernel

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

 From 2.6, cures compiler warnings.

Özkan Sezer


[-- Attachment #2: af_irda.c-2.6-fix.diff --]
[-- Type: text/plain, Size: 705 bytes --]

--- 27rc5~/net/irda/af_irda.c	2003-11-28 20:26:21.000000000 +0200
+++ 27rc5/net/irda/af_irda.c	2004-08-07 14:09:39.000000000 +0300
@@ -1900,11 +1900,10 @@
 		case IAS_STRING:
 			/* Should check charset & co */
 			/* Check length */
-			if(ias_opt->attribute.irda_attrib_string.len >
-			   IAS_MAX_STRING) {
-				kfree(ias_opt);
-				return -EINVAL;
-			}
+			/* The length is encoded in a __u8, and
+			 * IAS_MAX_STRING == 256, so there is no way
+			 * userspace can pass us a string too large.
+			 * Jean II */
 			/* NULL terminate the string (avoid troubles) */
 			ias_opt->attribute.irda_attrib_string.string[ias_opt->attribute.irda_attrib_string.len] = '\0';
 			/* Add a string attribute */


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

only message in thread, other threads:[~2004-08-13 19:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-13 18:56 [PATCH 2.4] af_irda.c comparison fix O.Sezer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.