Skip to content

Do not attempt to read 0 bytes when manually iterating over a non-seekable file - #25804

Merged
rullzer merged 1 commit into
masterfrom
bugfix/noid/fread-0
Mar 1, 2021
Merged

Do not attempt to read 0 bytes when manually iterating over a non-seekable file#25804
rullzer merged 1 commit into
masterfrom
bugfix/noid/fread-0

Conversation

@juliusknorr

Copy link
Copy Markdown
Member

This makes sure that when fseek fails and we iterate over a file with fread in order to get to the requested chunk, the manual seek doesn't error by trying to read 0 bytes when the expected from position is reached.

Should fix occurences of: fread(): Length parameter must be greater than 0 at /var/www/nextcloud/lib/private/Files/View.php#460

Signed-off-by: Julius Härtl <jus@bitgrid.net>
@rullzer
rullzer merged commit 91f260f into masterMar 1, 2021
@rullzer
rullzer deleted the bugfix/noid/fread-0 branch March 1, 2021 08:54
@MorrisJobke

Copy link
Copy Markdown
Member

@juliushaertl@rullzer@ChristophWurst Backport to at least stable21?

@rullzer

Copy link
Copy Markdown
Member

/backport to stable21

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewsbug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@juliusknorr@MorrisJobke@rullzer@ChristophWurst