osmo-mslookup-client: fix dereferencing null
Fixes: CID#207543
Change-Id: Ia9ff5b2c767853dd00f577a7bc3583f408e061b5
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;