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

Thing Shadow: Fix potential shadow buffer overflow #124

Merged
merged 1 commit into from
Jan 12, 2018

Conversation

projectgus
Copy link
Contributor

@projectgus projectgus commented Jan 8, 2018

This isn't a problem for the default SHADOW_MAX_SIZE_OF_RX_BUFFER value, as the payload will be at most AWS_IOT_MQTT_RX_BUF_LEN bytes so there is room for the NULL byte. However if this value is changed to any lower value, it can overflow when writing the terminal NULL byte.

Thanks!

Potential overflow occurs if SHADOW_MAX_SIZE_OF_RX_BUFFER is overriden
to less than the default (AWS_IOT_MQTT_RX_BUF_LEN+1).
@projectgus projectgus force-pushed the bugfix/thing_shadow_overflow branch from 2539def to 19f92c9 Compare January 8, 2018 23:43
@vareddy-zz
Copy link
Contributor

Hi @projectgus ,
Thank you for your pull request! You are correct in that the buffer will overflow when it is changed to a lower value. We will test this fix and merge into master after our testing is complete.
Please let us know if you have any more questions or suggestions about the SDK.
Thanks!
Varun

@vareddy-zz vareddy-zz merged commit 9ad74d8 into aws:master Jan 12, 2018
gordonwang0 pushed a commit that referenced this pull request Apr 20, 2018
Potential overflow occurs if SHADOW_MAX_SIZE_OF_RX_BUFFER is overriden
to less than the default (AWS_IOT_MQTT_RX_BUF_LEN+1).
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

Successfully merging this pull request may close these issues.

2 participants