osmith has submitted this change. ( https://gerrit.osmocom.org/c/libgtpnl/+/34738?usp=email )
(
1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: gtp-genl: allocate room for maximum IPv6 address ......................................................................
gtp-genl: allocate room for maximum IPv6 address
Otherwise, inet_ntop() might return ENOSPC because of the buffer being too small to accomodate an IPv6 address.
Change-Id: I2283e0c3112bec8e6e7e7b5c96657facc09d0a7a --- M src/gtp-genl.c 1 file changed, 13 insertions(+), 1 deletion(-)
Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified laforge: Looks good to me, approved
diff --git a/src/gtp-genl.c b/src/gtp-genl.c index b8edc72..9c9e8d3 100644 --- a/src/gtp-genl.c +++ b/src/gtp-genl.c @@ -155,7 +155,7 @@ static int genl_gtp_attr_cb(const struct nlmsghdr *nlh, void *data) { struct nlattr *tb[GTPA_MAX + 1] = {}; - char buf[INET_ADDRSTRLEN]; + char buf[INET6_ADDRSTRLEN]; struct gtp_pdp pdp = {}; struct genlmsghdr *genl;