Skip to content

Commit

Permalink
Update sys/shell/commands/sc_nanocoap_vfs.c
Browse files Browse the repository at this point in the history
Co-authored-by: fabian18 <[email protected]>
  • Loading branch information
benpicco and fabian18 authored Jun 6, 2022
1 parent d30052a commit 7ebbe7d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sys/shell/commands/sc_nanocoap_vfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ int _nanocoap_put_handler(int argc, char **argv)
if (basename == NULL) {
return -EINVAL;
}
snprintf(buffer, sizeof(buffer), "%s%s", url, basename + 1);
if (snprintf(buffer, sizeof(buffer), "%s%s",
url, basename + 1) >= (int)sizeof(buffer)) {
puts("Constructed URI too long");
return -ENOBUFS;
}
url = buffer;
}

Expand Down

0 comments on commit 7ebbe7d

Please sign in to comment.