Skip to content

Commit b7ad50b

Browse files
lpereiraMaureenHelm
authored andcommitted
samples: net: rpl_border_router: Fix out-of-bounds write
While printing debugging information, an out of bounds write could happen while trying to write out the NUL byte in the url array. Coverity-ID: 178790 Signed-off-by: Leandro Pereira <[email protected]>
1 parent e7a3d01 commit b7ad50b

File tree

1 file changed

+1
-1
lines changed
  • samples/net/rpl_border_router/src

1 file changed

+1
-1
lines changed

samples/net/rpl_border_router/src/http.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1528,7 +1528,7 @@ static void http_connected(struct http_ctx *ctx,
15281528
void *user_data)
15291529
{
15301530
char url[32];
1531-
int len = min(sizeof(url), ctx->http.url_len);
1531+
size_t len = min(sizeof(url) - 1, ctx->http.url_len);
15321532

15331533
NET_DBG("");
15341534

0 commit comments

Comments
 (0)