Skip to content

Commit

Permalink
Fix buffer overrun
Browse files Browse the repository at this point in the history
Fix issue reported in eclipse-wakaama#676.

There are surely more similar issues to be found, but I have not tried to find
them.
  • Loading branch information
rettichschnidi committed Mar 24, 2023
1 parent 0ef0a08 commit 26ad900
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/json.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ int json_parse(lwm2m_uri_t * uriP,
_record_t * recordArray;
lwm2m_data_t * parsedP;

LOG_ARG("bufferLen: %d, buffer: \"%s\"", bufferLen, STR_NULL2EMPTY((char *)buffer));
LOG_ARG("bufferLen: %d, buffer: \"%.*s\"", bufferLen, bufferLen, STR_NULL2EMPTY((char *)buffer));
LOG_URI(uriP);
*dataP = NULL;
recordArray = NULL;
Expand Down
2 changes: 1 addition & 1 deletion data/senml_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ int senml_json_parse(const lwm2m_uri_t * uriP,
time_t baseTime;
lwm2m_data_t baseValue;

LOG_ARG("bufferLen: %d, buffer: \"%s\"", bufferLen, STR_NULL2EMPTY((char *)buffer));
LOG_ARG("bufferLen: %d, buffer: \"%.*s\"", bufferLen, bufferLen, STR_NULL2EMPTY((char *)buffer));
LOG_URI(uriP);
*dataP = NULL;
recordArray = NULL;
Expand Down

0 comments on commit 26ad900

Please sign in to comment.