file.read(bytes) is limited to 16kb for seemingly no reason
Lemmmy opened this issue · 1 comments
file.read(bytes) (as added by this PR) is limited to 16 kB on this line:
The result of this is an unhelpful "Count out of range" error.
One of three options would be preferable here:
- Remove the limit. It doesn't make much sense to be limiting at all in this case, as you can just file.readAll() just as maliciously.
- Increase the limit. 16 kB is a very low value for a limit like this. It could be increased to something more reasonable, perhaps in the megabytes range.
- Change the error message. The error message is entirely undescriptive here - it makes the user think they are trying to read more bytes than the file has, which is definitely not the case here. It could instead inform the user that they can only read this stupidly arbitrary number of bytes.
Fixed in a427930.