lkml.org 
[lkml]   [2008]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] NET: catch signed nla_len() retval in tcf_simp_init()
    'datalen' is unsigned, use 'ret' instead to catch a negative return value.

    Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
    ---
    diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c
    index fbde461..b78d015 100644
    --- a/net/sched/act_simple.c
    +++ b/net/sched/act_simple.c
    @@ -114,9 +114,10 @@ static int tcf_simp_init(struct nlattr *nla, struct nlattr *est,
    if (defdata == NULL)
    return -EINVAL;

    - datalen = nla_len(tb[TCA_DEF_DATA]);
    - if (datalen <= 0)
    + ret = nla_len(tb[TCA_DEF_DATA]);
    + if (ret <= 0)
    return -EINVAL;
    + datalen = ret;

    pc = tcf_hash_check(parm->index, a, bind, &simp_hash_info);
    if (!pc) {

    \
     
     \ /
      Last update: 2008-04-17 05:37    [W:0.020 / U:65.076 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site