Change in osmo-hlr[master]: osmo-mslookup-client: fix dereferencing null
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hlr/+/16844 ) Change subject: osmo-mslookup-client: fix dereferencing null .. osmo-mslookup-client: fix dereferencing null Fixes: CID#207543 Change-Id: Ia9ff5b2c767853dd00f577a7bc3583f408e061b5 --- M src/mslookup/osmo-mslookup-client.c 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/src/mslookup/osmo-mslookup-client.c b/src/mslookup/osmo-mslookup-client.c index 5f06d5f..4a9e587 100644 --- a/src/mslookup/osmo-mslookup-client.c +++ b/src/mslookup/osmo-mslookup-client.c @@ -456,6 +456,11 @@ rxbuf[rc] = '\0'; query_with_timeout = strtok(rxbuf, "\r\n"); + if (!query_with_timeout) { + print_error("ERROR: failed to read line from socket\n"); + goto close; + } + at = strchr(query_with_timeout, '@'); query_str = at ? at + 1 : query_with_timeout; -- To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/16844 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Change-Id: Ia9ff5b2c767853dd00f577a7bc3583f408e061b5 Gerrit-Change-Number: 16844 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith Gerrit-Reviewer: pespin Gerrit-MessageType: merged
Change in osmo-hlr[master]: osmo-mslookup-client: fix dereferencing null
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hlr/+/16844 ) Change subject: osmo-mslookup-client: fix dereferencing null .. Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/16844 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Change-Id: Ia9ff5b2c767853dd00f577a7bc3583f408e061b5 Gerrit-Change-Number: 16844 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin Gerrit-Comment-Date: Mon, 13 Jan 2020 15:07:49 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in osmo-hlr[master]: osmo-mslookup-client: fix dereferencing null
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hlr/+/16844 ) Change subject: osmo-mslookup-client: fix dereferencing null .. osmo-mslookup-client: fix dereferencing null Fixes: CID#207543 Change-Id: Ia9ff5b2c767853dd00f577a7bc3583f408e061b5 --- M src/mslookup/osmo-mslookup-client.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/44/16844/1 diff --git a/src/mslookup/osmo-mslookup-client.c b/src/mslookup/osmo-mslookup-client.c index fc9b56d..00677ef 100644 --- a/src/mslookup/osmo-mslookup-client.c +++ b/src/mslookup/osmo-mslookup-client.c @@ -456,6 +456,11 @@ rxbuf[rc] = '\0'; query_with_timeout = strtok(rxbuf, "\r\n"); + if (!query_with_timeout) { + print_error("ERROR: failed to read line from socket\n"); + goto close; + } + at = strchr(query_with_timeout, '@'); query_str = at ? at + 1 : query_with_timeout; -- To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/16844 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Change-Id: Ia9ff5b2c767853dd00f577a7bc3583f408e061b5 Gerrit-Change-Number: 16844 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-MessageType: newchange