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

coap_get_data() sets not exactly right pointer #4

Closed
DoumanAsh opened this issue Sep 2, 2015 · 2 comments
Closed

coap_get_data() sets not exactly right pointer #4

DoumanAsh opened this issue Sep 2, 2015 · 2 comments

Comments

@DoumanAsh
Copy link

The actual data is stored in position pdu->data++;
https://github.com/obgm/libcoap/blob/develop/src/pdu.c#L264

But the set value will be pdu->data which is COAP_PAYLOAD_START
So user must pay attention to that and increment data to get actual payload.

I would suggest to consider actually mentioning it in function description or change it return pointer to actual payload.

BTW: Also question is the same for received PDU?
From my experience it seems not to be so.

p.s. the problem is detected by valgrind when i trying to verify payload of created pdu

@DoumanAsh
Copy link
Author

Seems like i'm a bit misunderstood valgrind...
And seems like i misunderstood code too...

Sorry about that

@obgm
Copy link
Owner

obgm commented Sep 2, 2015 via email

mrdeep1 added a commit to mrdeep1/libcoap that referenced this issue Nov 5, 2022
mrdeep1 added a commit to mrdeep1/libcoap that referenced this issue Nov 5, 2022
mrdeep1 added a commit to mrdeep1/libcoap that referenced this issue Nov 5, 2022
mrdeep1 added a commit to mrdeep1/libcoap that referenced this issue Nov 5, 2022
mrdeep1 added a commit to mrdeep1/libcoap that referenced this issue Nov 5, 2022
mrdeep1 added a commit to mrdeep1/libcoap that referenced this issue Nov 7, 2022
mrdeep1 added a commit to mrdeep1/libcoap that referenced this issue Nov 28, 2022
mrdeep1 added a commit to mrdeep1/libcoap that referenced this issue Nov 30, 2022
mrdeep1 added a commit to mrdeep1/libcoap that referenced this issue Dec 9, 2022
mrdeep1 added a commit to mrdeep1/libcoap that referenced this issue Dec 13, 2022
mrdeep1 added a commit to mrdeep1/libcoap that referenced this issue Dec 17, 2022
mrdeep1 added a commit to mrdeep1/libcoap that referenced this issue Dec 20, 2022
mrdeep1 added a commit to mrdeep1/libcoap that referenced this issue Dec 30, 2022
mrdeep1 added a commit to mrdeep1/libcoap that referenced this issue Dec 30, 2022
mrdeep1 added a commit to mrdeep1/libcoap that referenced this issue Jan 2, 2023
mrdeep1 added a commit to mrdeep1/libcoap that referenced this issue Jan 2, 2023
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

2 participants