simple_ctrl: Check for NULL return of simple_ctrl_xceive

Change-Id: Ice1e0b9819d8e24770bc57295dd1455f38c37bd5
This commit is contained in:
Harald Welte 2018-06-05 19:08:58 +02:00
parent 6ccc80c0d5
commit 47fb3838ef
1 changed files with 2 additions and 0 deletions

View File

@ -304,6 +304,8 @@ int simple_ctrl_set(struct simple_ctrl_handle *sch, const char *var, const char
return -1;
}
resp = simple_ctrl_xceive(sch, msg);
if (!resp)
return -1;
if (sscanf(msgb_l2(resp), "SET_REPLY %u %ms %ms", &rx_id, &rx_var, &rx_val) == 3) {
if (rx_id == sch->next_id-1 && !strcmp(var, rx_var) && !strcmp(val, rx_val)) {