diff options
author | Martin Schiller <ms@dev.tdt.de> | 2018-11-27 03:50:27 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-11-29 17:25:36 -0500 |
commit | d449ba3d581ed29f751a59792fdc775572c66904 (patch) | |
tree | 4ca63c8cfc5da2b74cac40c5b22b93b077c37670 /net/x25 | |
parent | 90230968f102acbe103fbf7c03d41addfef5f153 (diff) |
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 <ms@dev.tdt.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/x25')
-rw-r--r-- | net/x25/af_x25.c | 2 |
1 files changed, 1 insertions, 1 deletions
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, | |||
100 | } | 100 | } |
101 | 101 | ||
102 | len = *skb->data; | 102 | len = *skb->data; |
103 | needed = 1 + (len >> 4) + (len & 0x0f); | 103 | needed = 1 + ((len >> 4) + (len & 0x0f) + 1) / 2; |
104 | 104 | ||
105 | if (!pskb_may_pull(skb, needed)) { | 105 | if (!pskb_may_pull(skb, needed)) { |
106 | /* packet is too short to hold the addresses it claims | 106 | /* packet is too short to hold the addresses it claims |