diff options
author | Dan Carpenter <error27@gmail.com> | 2010-09-04 03:14:35 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-07 13:57:22 -0700 |
commit | cf9b94f88bdbe8a02015fc30d7c232b2d262d4ad (patch) | |
tree | 8e279d2e0b9b3e2d165a2669da002cf7324d24b0 /net/irda | |
parent | 89b12faba4f3441c9457c5278851e8a93ffd008d (diff) | |
download | linux-3.10-cf9b94f88bdbe8a02015fc30d7c232b2d262d4ad.tar.gz linux-3.10-cf9b94f88bdbe8a02015fc30d7c232b2d262d4ad.tar.bz2 linux-3.10-cf9b94f88bdbe8a02015fc30d7c232b2d262d4ad.zip |
irda: off by one
This is an off by one. We would go past the end when we NUL terminate
the "value" string at end of the function. The "value" buffer is
allocated in irlan_client_parse_response() or
irlan_provider_parse_command().
CC: stable@kernel.org
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/irda')
-rw-r--r-- | net/irda/irlan/irlan_common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c index a788f9e9427..6130f9d9dbe 100644 --- a/net/irda/irlan/irlan_common.c +++ b/net/irda/irlan/irlan_common.c @@ -1102,7 +1102,7 @@ int irlan_extract_param(__u8 *buf, char *name, char *value, __u16 *len) memcpy(&val_len, buf+n, 2); /* To avoid alignment problems */ le16_to_cpus(&val_len); n+=2; - if (val_len > 1016) { + if (val_len >= 1016) { IRDA_DEBUG(2, "%s(), parameter length to long\n", __func__ ); return -RSP_INVALID_COMMAND_FORMAT; } |