Page MenuHomePhorge

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

Authored by mollekopf on Aug 11 2020, 9:34 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 18, 12:48 PM
Unknown Object (File)
Tue, Apr 16, 8:58 PM
Unknown Object (File)
Mar 5 2024, 3:01 PM
Unknown Object (File)
Mar 5 2024, 3:01 PM
Unknown Object (File)
Feb 21 2024, 6:38 PM
Unknown Object (File)
Feb 15 2024, 3:51 PM
Unknown Object (File)
Feb 15 2024, 6:33 AM
Unknown Object (File)
Feb 14 2024, 8:51 AM
Subscribers
None

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
Branch
master
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 30115
Build 11218: arc lint + arc unit

Event Timeline

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?)

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.