Skip to content

Commit

Permalink
Fix for a potential buffer overflow during the bootstrap process
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Tusnio <[email protected]>
  • Loading branch information
mtusnio committed Dec 1, 2016
1 parent c57b5ca commit 78e2e26
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/client/lwm2m_bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ static void SendBootStrapRequest(Lwm2mContextType * context, int shortServerID)
char uri[1024];

Lwm2mCore_GetEndPointClientName(context, buffer, sizeof(buffer));
sprintf(uriQuery, "?ep=%s", buffer);
snprintf(uriQuery, sizeof(uriQuery), "?ep=%s", buffer);

Lwm2m_GetServerURI(context, shortServerID, serverPath, sizeof(serverPath));

sprintf(uri, "%s%s%s", serverPath, uriPath, uriQuery);
snprintf(uri, sizeof(uri), "%s%s%s", serverPath, uriPath, uriQuery);
Lwm2m_Info("Bootstrap with %s\n", uri);

coap_Reset(uri);
Expand Down

0 comments on commit 78e2e26

Please sign in to comment.