From: Martin Schiller Date: Tue, 27 Nov 2018 08:50:27 +0000 (+0100) Subject: net/x25: fix called/calling length calculation in x25_parse_address_block X-Git-Tag: Ubuntu-5.2.0-15.16~3021^2~49 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=d449ba3d581ed29f751a59792fdc775572c66904;p=mirror_ubuntu-eoan-kernel.git net/x25: fix called/calling length calculation in x25_parse_address_block The length of the called and calling address was not calculated correctly (BCD encoding). Signed-off-by: Martin Schiller Signed-off-by: David S. Miller --- diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index d49aa79b7997..5226a7f43050 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c @@ -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