Page MenuHomekolab.org

Protect against a 0-length for parameters as well.
ClosedPublic

Authored by mollekopf on Aug 11 2020, 9:34 AM.

Details

Summary

Encountered with a tag of 0 (attachmentname), but that might be
coincidence. We are already protecting above against 0-length which we
may run into if the stream is truncated for some reason.

Since this is not treated above as an error, I'm not treating it as one
here either.

Diff Detail

Repository
rS syncroton
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mollekopf requested review of this revision.Aug 11 2020, 9:34 AM
mollekopf created this revision.

It's not quite clear to me how simply ignoring if the stream is at the end is a valid error handling strategy (it seems we aren't buffering the existing data, so it would be lost?), but if it's acceptable for the properties above I suppose it is ok here too.

@machniak Maybe you know more about what guarantees we do and don't have, and if we should turn all of the 0-length occurrences into errors. (I don't suppose with http we can receive part of a command?)

machniak accepted this revision.Aug 11 2020, 9:48 AM

I guess we could also check the result of the first fread($stream, 1), but I think the proposed change is good enough.

This revision is now accepted and ready to land.Aug 11 2020, 9:48 AM
This revision was automatically updated to reflect the committed changes.