Skip to contentSkip to conversation

X.25: Fix address field length calculation

PATCH New Kelleter, Günther 1 participant 1 message Oct 2, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 X.25: Fix address field length calculation

Addresses are BCD encoded, not ASCII. x25_addr_ntoa got it right.

---
 net/x25/af_x25.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/x25/af_x25.c +1 -1
index 45a3ab5..2daf224 100644
@@ -98,7 +98,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
Signature · 1 line
1.8.3.4.71.g0878476