mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "O.Sezer" <sezeroz@ttnet.net.tr>
To: linux-kernel@vger.kernel.org
Subject: [PATCH 2.4] af_irda.c comparison fix
Date: Fri, 13 Aug 2004 21:56:44 +0300	[thread overview]
Message-ID: <411D0EEC.2080003@ttnet.net.tr> (raw)

[-- 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 */


                 reply	other threads:[~2004-08-13 19:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=411D0EEC.2080003@ttnet.net.tr \
    --to=sezeroz@ttnet.net.tr \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®