public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] irda: fix type of struct irda_ias_set.attribute.irda_attrib_string.len
@ 2003-11-11  2:06 Arnaldo Carvalho de Melo
  2003-11-11  2:59 ` Linus Torvalds
  0 siblings, 1 reply; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2003-11-11  2:06 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton, Dag Brattli, Jean Tourrilhes
  Cc: Linux Kernel Mailing List, irda-users

  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;

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-12-30 12:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-11  2:06 [PATCH] irda: fix type of struct irda_ias_set.attribute.irda_attrib_string.len Arnaldo Carvalho de Melo
2003-11-11  2:59 ` Linus Torvalds
2003-11-11  3:07   ` Linus Torvalds
2003-12-30 12:39     ` Paul Jackson
2003-11-11 17:18   ` Jean Tourrilhes

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