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

Possible buffer overflow in the 7-bits data mode #59

Open
vnodeng opened this issue May 10, 2022 · 1 comment
Open

Possible buffer overflow in the 7-bits data mode #59

vnodeng opened this issue May 10, 2022 · 1 comment

Comments

@vnodeng
Copy link
Contributor

vnodeng commented May 10, 2022

The code in the usb_cdc.c:usb_cdc_port_send_rx_usb() function looks a little bit suspicious: in the 7-bits data mode it clears MSB of received data in the circular buffer treating it as linear buffer. Since the amount of affected bytes calculated as total number of bytes stored, this may lead buf_ptr pointer to run out of circular buffer bounds.

@r2axz
Copy link
Owner

r2axz commented May 11, 2022

Hi,

Looks like it does, thanks for pointing this out. 7-bit mode is somewhat limited in bluebill-serial-monster. For instance, it can only work when the parity bit is enabled due to the hardware limitations. I've never actually properly tested this mode other than playing with it in terminal software. Will take a closer look into this in a couple of days.

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

2 participants