Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit dd5bc81

Browse files
committed
LWM2M: Fix a NULL pointer deference.
After setting client->bootstrap_ctx.server_uri to NULL, a SOL_WRN() statement was trying to print the contents of client->bootstrap_ctx.server_uri. Signed-off-by: Guilherme Iscaro <[email protected]>
1 parent 9eab9d6 commit dd5bc81

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lib/comms/sol-lwm2m.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4621,8 +4621,6 @@ client_bootstrap(void *data)
46214621
conn_ctx = server_connection_ctx_new(client,
46224622
sol_str_slice_from_blob(client->bootstrap_ctx.server_uri),
46234623
DEFAULT_SHORT_SERVER_ID);
4624-
sol_blob_unref(client->bootstrap_ctx.server_uri);
4625-
client->bootstrap_ctx.server_uri = NULL;
46264624

46274625
if (!conn_ctx) {
46284626
SOL_WRN("Could not perform Client-initiated Bootstrap with server %.*s",
@@ -4636,6 +4634,9 @@ client_bootstrap(void *data)
46364634
SOL_WRN("Could not unregister Bootstrap Finish resource for client.");
46374635
}
46384636

4637+
sol_blob_unref(client->bootstrap_ctx.server_uri);
4638+
client->bootstrap_ctx.server_uri = NULL;
4639+
46394640
return false;
46404641
}
46414642

0 commit comments

Comments
 (0)