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

Inappropriate file open mode used for /dev/null in fuzzing driver #328

Open
MarkLee131 opened this issue Sep 10, 2024 · 1 comment · May be fixed by #331
Open

Inappropriate file open mode used for /dev/null in fuzzing driver #328

MarkLee131 opened this issue Sep 10, 2024 · 1 comment · May be fixed by #331
Assignees
Labels

Comments

@MarkLee131
Copy link

Describe the bug

In the fuzzing driver code (shown below), the file /dev/null is opened in "r" (read) mode which is typically used for reading input. However, the common practice when directing output to /dev/null, especially in testing or logging scenarios, is to open it in "w" (write) mode. This issue can potentially lead to misunderstandings or misuse of file handling in the driver.

State() : fout(fopen("/dev/null", "r")) {

Expected behavior

If my understanding is correct, this line should be modified to open /dev/null in "w" mode to adhere to its intended use as an output discard mechanism.

Looking forward to your kind reply or explanation. Thanks in advance. :)

@MarkLee131 MarkLee131 added the bug label Sep 10, 2024
@PJK PJK linked a pull request Oct 11, 2024 that will close this issue
@PJK
Copy link
Owner

PJK commented Oct 11, 2024

Thanks for the bug report, sending #331, just need to fix CI first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants