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

Check reason string in MQTT5 samples #772

Merged
merged 2 commits into from
Jan 8, 2025
Merged

Check reason string in MQTT5 samples #772

merged 2 commits into from
Jan 8, 2025

Conversation

sfod
Copy link
Contributor

@sfod sfod commented Jan 8, 2025

Issue #, if available:

In MQTT5 protocol, if subscription fail, SubAck packet not necessarily contains a reason string. In MQTT5 samples, we try to print a SubAck reason string unconditionally, which sometimes crashes samples.
The same applies to publish operations.

Description of changes:

Add check for a reason string value before using it.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@sfod sfod merged commit 284eea0 into main Jan 8, 2025
39 of 40 checks passed
@sfod sfod deleted the fix-segfault branch January 8, 2025 23:51
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.

3 participants