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

DS::FileStream::atEof() UB #185

Open
Hoikas opened this issue Aug 27, 2023 · 0 comments
Open

DS::FileStream::atEof() UB #185

Hoikas opened this issue Aug 27, 2023 · 0 comments
Labels

Comments

@Hoikas
Copy link
Member

Hoikas commented Aug 27, 2023

DS::FileStream::atEof() relies on undefined behavior if the file is opened in read mode. It basically tests for EOF by trying to read a character from the file and put the character back for future read attempts. In Ubuntu 20.04 on WSL2, this causes the character read by atEof() to be discarded. This is also true for Alpine running in a docker container on WSL2.

@Hoikas Hoikas added the Bug label Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant