lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/39013?usp=email ) Change subject: gprs_ns2_sns: do_sns_add: ensure ip4/ip6 pointer is set ...................................................................... gprs_ns2_sns: do_sns_add: ensure ip4/ip6 pointer is set To make clang analyser happy. It is also a good check, to ensure the correct address contains valida data Change-Id: I22c0096dca75bc69cdf396b240ac590d949eeb0a --- M src/gb/gprs_ns2_sns.c 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/13/39013/1 diff --git a/src/gb/gprs_ns2_sns.c b/src/gb/gprs_ns2_sns.c index dbfc332..de0400f 100644 --- a/src/gb/gprs_ns2_sns.c +++ b/src/gb/gprs_ns2_sns.c @@ -745,12 +745,16 @@ case AF_INET: if (gss->remote.num_ip4 >= gss->num_max_ip4_remote) return -NS_CAUSE_INVAL_NR_NS_VC; + if (!ip4) + return -NS_CAUSE_PROTO_ERR_UNSPEC; /* TODO: log message duplicate */ rc = add_ip4_elem(gss, &gss->remote, ip4); break; case AF_INET6: if (gss->remote.num_ip6 >= gss->num_max_ip6_remote) return -NS_CAUSE_INVAL_NR_NS_VC; + if (!ip6) + return -NS_CAUSE_PROTO_ERR_UNSPEC; /* TODO: log message duplicate */ rc = add_ip6_elem(gss, &gss->remote, ip6); break; -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/39013?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I22c0096dca75bc69cdf396b240ac590d949eeb0a Gerrit-Change-Number: 39013 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis@fe80.eu>