From 61896d932867c750440cd99cd7dac59accfcc1fb Mon Sep 17 00:00:00 2001 From: Michal Tusnio Date: Thu, 1 Dec 2016 14:10:15 +0000 Subject: [PATCH] Fix for a potential buffer overflow during the bootstrap process Signed-off-by: Michal Tusnio --- core/src/client/lwm2m_bootstrap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/client/lwm2m_bootstrap.c b/core/src/client/lwm2m_bootstrap.c index acbbf45..b99645b 100644 --- a/core/src/client/lwm2m_bootstrap.c +++ b/core/src/client/lwm2m_bootstrap.c @@ -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);