Skip to content

Fix buffer size check in cpp-preproc.c when reading lines with fgets#271

Open
pps83 wants to merge 1 commit intoyasm:masterfrom
pps83:cpp-fgets-fix
Open

Fix buffer size check in cpp-preproc.c when reading lines with fgets#271
pps83 wants to merge 1 commit intoyasm:masterfrom
pps83:cpp-fgets-fix

Conversation

@pps83
Copy link

@pps83 pps83 commented Mar 28, 2024

fgets reads at most bufsize-1 chars, the check for the full buffer has to account for the trailing NULL char. This code matches line reading code of gas-preproc.c

@pps83
Copy link
Author

pps83 commented Mar 28, 2024

Without this fix long lines case yasm to deadlock

@pps83
Copy link
Author

pps83 commented Nov 29, 2024

@PeterJohnson please take a look

fgets reads at most bufsize-1 chars, the check for the full buffer has to account for the trailing NULL char. This code matches line reading code of gas-preproc.c
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.

1 participant