irda: off by one
Subsystems (3)
PATCH 1/1 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().
Signed-off-by Dan Carpenter <[email protected]>
net/irda/irlan/irlan_common.c +1 -1
@@ -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 ; }
From: Dan Carpenter <[email protected]>
Date: Sat, 4 Sep 2010 15:14:35 +0200
Quoted 7 lines
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()orirlan_provider_parse_command().Signed-off-by Dan Carpenter <[email protected]>
Applied.