lkml.org 
[lkml]   [2003]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] irda: fix type of struct irda_ias_set.attribute.irda_attrib_string.len
      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;
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/
    \
     
     \ /
      Last update: 2005-03-22 13:58    [W:0.024 / U:30.404 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site