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

Truncates payload if it doesn't fit in buffer #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Dec 17, 2016

  1. Truncates payload if it doesn't fit in buffer

    When function Adafruit_MQTT::publishPacket constructs the MQTT packets to be published, no validation was done to make sure that the function never writes more than MAXBUFFERSIZE into buffer. This could lead to very difficult to debug problems, because the program quickly crashes after writing more than MAXBUFFERSIZE into buffer. This proposed change truncates the payload (only if necessary) to fit buffer. Of course, truncating the payload is still a problem, but it is easier to debug and find. A debug message will let know that the payload was truncated to fit MAXBUFFERSIZE.
    oeretana committed Dec 17, 2016
    Configuration menu
    Copy the full SHA
    851dc3b View commit details
    Browse the repository at this point in the history