diff options
author | Oliver Smith <osmith@sysmocom.de> | 2020-01-13 15:11:53 +0100 |
---|---|---|
committer | Oliver Smith <osmith@sysmocom.de> | 2020-01-14 08:40:34 +0100 |
commit | 9e533f666dff98b0462767513dc15fd0072e8f42 (patch) | |
tree | 2e6889953385261107a98f43beb5a48ea64f7a1a | |
parent | 544b15d3faa123de2c399dfa974c67ad448508b2 (diff) |
osmo-mslookup-client: fix dereferencing null
Fixes: CID#207543
Change-Id: Ia9ff5b2c767853dd00f577a7bc3583f408e061b5
-rw-r--r-- | src/mslookup/osmo-mslookup-client.c | 5 |
1 files changed, 5 insertions, 0 deletions
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 @@ static int socket_read_cb(struct osmo_fd *ofd) 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; |