Skip to content

Bug in Stream::findUntil when stream contains NUL (0x00) characters #2507

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

Closed
trickedj opened this issue Dec 23, 2014 · 1 comment
Closed
Milestone

Comments

@trickedj
Copy link

findUntil, used also by 'find' in 'Stream' and 'Serial', has a bug if the received data being searched contains NUL (0x00) characters.

Line 105 in stream.cpp is currently
while( (c = timedRead()) > 0){
The intention is that the while loop is executed as long as characters are being received but exits on timeout. However as it is currently written, a received zero character will be interpreted as a timeout.
The fix is to make the compare >= IE
while( (c = timedRead()) >= 0){

This affects all versions of the IDE up to 1.5.8 in both the AVR and SAM core

@Chris--A
Copy link
Contributor

Resolved: f43a7a6

@cmaglie cmaglie closed this as completed May 19, 2015
@ffissore ffissore modified the milestone: Release 1.6.5 May 20, 2015
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

4 participants