gtp: ensure sufficient room for the header in gtp0_udp_encap_recv

This commit is contained in:
Pablo Neira Ayuso 2014-02-20 12:18:13 +01:00
parent d123a0c0f5
commit 20d702b90e
1 changed files with 4 additions and 0 deletions

4
gtp.c
View File

@ -227,6 +227,10 @@ static int gtp0_udp_encap_recv(struct gtp_instance *gti, struct sk_buff *skb)
pr_info("gtp0 udp received\n");
/* check for sufficient header size */
if (!pskb_may_pull(skb, sizeof(*gtp0)))
return -1;
gtp0 = (struct gtp0_header *)skb->data;
/* check for GTP Version 0 */