lib/gtp-kernel.c: check rc of in46a_from_eua
Fixes: b17fe7bf ("kernel-gtp: support IPv6 on inner layer")
Change-Id: I40e4de1517de8871224a45c173208810b42312ff
diff --git a/lib/gtp-kernel.c b/lib/gtp-kernel.c
index 3ad8424..6a14d78 100644
--- a/lib/gtp-kernel.c
+++ b/lib/gtp-kernel.c
@@ -115,6 +115,8 @@
in46a_from_gsna(&pdp->gsnrc, &sgsn);
ms_addr_count = in46a_from_eua(&pdp->eua, ms);
+ if (ms_addr_count < 0)
+ return -1;
for (int i = 0; i < ms_addr_count; i++) {
t = gtp_tunnel_alloc();
@@ -169,6 +171,8 @@
pdp_debug(__func__, devname, pdp);
ms_addr_count = in46a_from_eua(&pdp->eua, ms);
+ if (ms_addr_count < 0)
+ return -1;
for (int i = 0; i < ms_addr_count; i++) {
t = gtp_tunnel_alloc();