public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
To: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
	Dag Brattli <dag@brattli.net>, Jean Tourrilhes <jt@hpl.hp.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	irda-users@lists.sourceforge.net
Subject: [PATCH] irda: fix type of struct irda_ias_set.attribute.irda_attrib_string.len
Date: Tue, 11 Nov 2003 00:06:08 -0200	[thread overview]
Message-ID: <20031111020608.GA1208@conectiva.com.br> (raw)

  CC [M]  net/irda/af_irda.o
net/irda/af_irda.c: In function `irda_setsockopt':
net/irda/af_irda.c:1894: warning: comparison is always false due to limited range of data type

in irda_setsockopt:

                        /* Should check charset & co */
                        /* Check length */
                        if(ias_opt->attribute.irda_attrib_string.len >
                           IAS_MAX_STRING) {
                                kfree(ias_opt);
                                return -EINVAL;
                        }

Ok, ias_opt->attribute.irda_attrib_string.len is __u8, but
IAS_MAX_STRING = 256... so attribute.irda_attrib_string.len has to be at least
__u18, this patch fix this, please see if it is appropriate and if it is so,
apply.

Best Regards,

- Arnaldo

===== include/linux/irda.h 1.7 vs edited =====
--- 1.7/include/linux/irda.h	Wed Jun  4 11:16:33 2003
+++ edited/include/linux/irda.h	Mon Nov 10 23:56:33 2003
@@ -151,7 +151,7 @@
 			__u8 octet_seq[IAS_MAX_OCTET_STRING];
 		} irda_attrib_octet_seq;
 		struct {
-			__u8 len;
+			__u16 len;
 			__u8 charset;
 			__u8 string[IAS_MAX_STRING];
 		} irda_attrib_string;

             reply	other threads:[~2003-11-11  2:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-11  2:06 Arnaldo Carvalho de Melo [this message]
2003-11-11  2:59 ` [PATCH] irda: fix type of struct irda_ias_set.attribute.irda_attrib_string.len Linus Torvalds
2003-11-11  3:07   ` Linus Torvalds
2003-12-30 12:39     ` Paul Jackson
2003-11-11 17:18   ` Jean Tourrilhes

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=20031111020608.GA1208@conectiva.com.br \
    --to=acme@conectiva.com.br \
    --cc=akpm@osdl.org \
    --cc=dag@brattli.net \
    --cc=irda-users@lists.sourceforge.net \
    --cc=jt@hpl.hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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