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

Bug : Infinite while loop error log causes disk to be full #25

Open
sergeByishimo opened this issue Nov 9, 2022 · 0 comments
Open

Bug : Infinite while loop error log causes disk to be full #25

sergeByishimo opened this issue Nov 9, 2022 · 0 comments

Comments

@sergeByishimo
Copy link

sergeByishimo commented Nov 9, 2022

Hi!

Below codes in question found in app/Config/setup.php line 100,101,102

$check_file = fopen($check_constants_filename, "a+");
while (!feof($check_file)) {
    $check_line = fgets($check_file);

If fopen() above the while condition returned a false boolean instead of the expected resource stream parameter, it logs this error

PHP Warning: feof() expects parameter 1 to be resource, boolean given in ../app/Config/setup.php on line 101, referer: http://localhost/dashboard

Which because the feof() function is in a while loop condition, it causes an infinite loop that leads to the disk becoming full because of that error being logged in an infinite loop.

IMO fopen() might return false because the file permissions are not configured right, but that doesnt mean orangescrum should fill the whole disk with that error.

I saw this kind of structure in multiple places in the codes. It would be fixed by an if condition before the while loop, checking if fopen() did not return a false boolean.

Let me know if a pull request is welcome, I will be glad to contribute.

Best regards,

@sergeByishimo sergeByishimo changed the title Infinite while loop error log causes disk to be full BUG : Infinite while loop error log causes disk to be full Nov 9, 2022
@sergeByishimo sergeByishimo changed the title BUG : Infinite while loop error log causes disk to be full Bug : Infinite while loop error log causes disk to be full Nov 9, 2022
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

1 participant