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

Commit

Permalink
LWM2M: Fix a NULL pointer deference.
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
cabelitos committed Jul 5, 2016
1 parent 9eab9d6 commit dd5bc81
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/comms/sol-lwm2m.c
Original file line number Diff line number Diff line change
Expand Up @@ -4621,8 +4621,6 @@ client_bootstrap(void *data)
conn_ctx = server_connection_ctx_new(client,
sol_str_slice_from_blob(client->bootstrap_ctx.server_uri),
DEFAULT_SHORT_SERVER_ID);
sol_blob_unref(client->bootstrap_ctx.server_uri);
client->bootstrap_ctx.server_uri = NULL;

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

sol_blob_unref(client->bootstrap_ctx.server_uri);
client->bootstrap_ctx.server_uri = NULL;

return false;
}

Expand Down

0 comments on commit dd5bc81

Please sign in to comment.