mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
net/x25: fix called/calling length calculation in x25_parse_address_block
[ Upstream commit d449ba3d58 ]
The length of the called and calling address was not calculated
correctly (BCD encoding).
Signed-off-by: Martin Schiller <ms@dev.tdt.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b7950442f2
commit
12fc4bcc89
@@ -100,7 +100,7 @@ int x25_parse_address_block(struct sk_buff *skb,
|
||||
}
|
||||
|
||||
len = *skb->data;
|
||||
needed = 1 + (len >> 4) + (len & 0x0f);
|
||||
needed = 1 + ((len >> 4) + (len & 0x0f) + 1) / 2;
|
||||
|
||||
if (!pskb_may_pull(skb, needed)) {
|
||||
/* packet is too short to hold the addresses it claims
|
||||
|
||||
Reference in New Issue
Block a user