Skip to content

drivers/xbee: prevent 0 length packet sent to UART#11332

Merged
miri64 merged 1 commit intoRIOT-OS:masterfrom
kYc0o:pr/xbee/prevent_0_len_uart
Apr 2, 2019
Merged

drivers/xbee: prevent 0 length packet sent to UART#11332
miri64 merged 1 commit intoRIOT-OS:masterfrom
kYc0o:pr/xbee/prevent_0_len_uart

Conversation

@kYc0o
Copy link
Copy Markdown
Contributor

@kYc0o kYc0o commented Apr 2, 2019

Contribution description

This PR prevents the xbee driver to write 0 len frames into UART, for which is not specified if it's valid or not. It also spares a uart_write() operation if it's not needed.

Testing procedure

See #11163.

Issues/PRs references

#11163

Since the API doc doesn't specify what to do with 0
len writings into UART, we cannot assume that is
safe to do it, so this commit prevents it by checking
the length prior to the `uart_write()` operation.
@kYc0o kYc0o added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Apr 2, 2019
@kYc0o kYc0o added this to the Release 2019.04 milestone Apr 2, 2019
@kYc0o kYc0o requested a review from miri64 April 2, 2019 14:52
Copy link
Copy Markdown
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't get my hands on some hardware at the moment to test. But the code change is simple enough that I don't believe that it will break anything even if merged untested.

@miri64 miri64 merged commit a1e2dc0 into RIOT-OS:master Apr 2, 2019
@kYc0o
Copy link
Copy Markdown
Contributor Author

kYc0o commented Apr 2, 2019

Thanks!

@kYc0o kYc0o deleted the pr/xbee/prevent_0_len_uart branch April 2, 2019 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants