Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lwm2m: Accessing uninitialized local variables #2864

Open
szsam opened this issue Mar 5, 2024 · 0 comments
Open

lwm2m: Accessing uninitialized local variables #2864

szsam opened this issue Mar 5, 2024 · 0 comments

Comments

@szsam
Copy link
Contributor

szsam commented Mar 5, 2024

if(coap_is_option(request, COAP_OPTION_BLOCK1)) {
LOG_DBG("Setting BLOCK 1 num:%"PRIu32" o2:%"PRIu32" o:%"PRId32"\n", bnum, boffset,
(offset != NULL ? *offset : 0));
coap_set_header_block1(response, bnum, 0, bsize);

bnum and bsize are uninitialized in line 1602 if the condition (offset != NULL && *offset == 0) does not hold:
/* PUT/POST - e.g. write will not send in offset here - Maybe in the future? */
if((offset != NULL && *offset == 0) &&
coap_is_option(request, COAP_OPTION_BLOCK1)) {
coap_get_header_block1(request, &bnum, &bmore, &bsize, &boffset);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant