Skip to content

Commit

Permalink
system/ambient: Fix tainted buffer access
Browse files Browse the repository at this point in the history
Fix tainted access to the receive buffer.

Detected by CodeSonar 1078252
  • Loading branch information
SPRESENSE committed Mar 25, 2022
1 parent f43fa24 commit 57752f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sdk/system/ambient/ambient.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ int ambient_send(FAR ambient_ctx_t *ctx)

usleep(30 * 1000);

ret = recv(sockfd, iobuffer, IOBUFFER_MAXLEN, 0);
ret = recv(sockfd, iobuffer, IOBUFFER_MAXLEN - 1, 0);
if (ret < 0)
{
nerr("ERROR: recv failed: %d\n", errno);
Expand Down

0 comments on commit 57752f0

Please sign in to comment.