diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2013-05-07 07:25:02 -0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2013-05-09 06:39:44 -0400 |
commit | 7da19971a9da9c5e63d259c9a8a566f071dc95d0 (patch) | |
tree | 8d41bbb80871afc29ce0db4014a8e2c551e898e5 /net | |
parent | 293c9c1cef6be46ad72b528fa79c3ff034551fe0 (diff) |
batman-adv: check return value of pskb_trim_rcsum()
Reported-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Acked-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/batman-adv/network-coding.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/batman-adv/network-coding.c b/net/batman-adv/network-coding.c index f7c54305a918..e84629ece9b7 100644 --- a/net/batman-adv/network-coding.c +++ b/net/batman-adv/network-coding.c | |||
@@ -1514,6 +1514,7 @@ batadv_nc_skb_decode_packet(struct batadv_priv *bat_priv, struct sk_buff *skb, | |||
1514 | struct ethhdr *ethhdr, ethhdr_tmp; | 1514 | struct ethhdr *ethhdr, ethhdr_tmp; |
1515 | uint8_t *orig_dest, ttl, ttvn; | 1515 | uint8_t *orig_dest, ttl, ttvn; |
1516 | unsigned int coding_len; | 1516 | unsigned int coding_len; |
1517 | int err; | ||
1517 | 1518 | ||
1518 | /* Save headers temporarily */ | 1519 | /* Save headers temporarily */ |
1519 | memcpy(&coded_packet_tmp, skb->data, sizeof(coded_packet_tmp)); | 1520 | memcpy(&coded_packet_tmp, skb->data, sizeof(coded_packet_tmp)); |
@@ -1568,8 +1569,11 @@ batadv_nc_skb_decode_packet(struct batadv_priv *bat_priv, struct sk_buff *skb, | |||
1568 | coding_len); | 1569 | coding_len); |
1569 | 1570 | ||
1570 | /* Resize decoded skb if decoded with larger packet */ | 1571 | /* Resize decoded skb if decoded with larger packet */ |
1571 | if (nc_packet->skb->len > coding_len + h_size) | 1572 | if (nc_packet->skb->len > coding_len + h_size) { |
1572 | pskb_trim_rcsum(skb, coding_len + h_size); | 1573 | err = pskb_trim_rcsum(skb, coding_len + h_size); |
1574 | if (err) | ||
1575 | return NULL; | ||
1576 | } | ||
1573 | 1577 | ||
1574 | /* Create decoded unicast packet */ | 1578 | /* Create decoded unicast packet */ |
1575 | unicast_packet = (struct batadv_unicast_packet *)skb->data; | 1579 | unicast_packet = (struct batadv_unicast_packet *)skb->data; |