[tor-bugs] #26348 [Circumvention/Snowflake]: Guard against large reads
Tor Bug Tracker & Wiki
blackhole at torproject.org
Thu May 16 03:44:20 UTC 2019
#26348: Guard against large reads
-----------------------------------------------+---------------------------
Reporter: dcf | Owner: cohosh
Type: defect | Status:
| merge_ready
Priority: Medium | Milestone:
Component: Circumvention/Snowflake | Version:
Severity: Normal | Resolution:
Keywords: easy anti-censorship-roadmap-2019 | Actual Points:
Parent ID: | Points: 1
Reviewer: | Sponsor: Sponsor19
-----------------------------------------------+---------------------------
Changes (by dcf):
* status: needs_review => merge_ready
Comment:
Okay, this looks fine to me.
I thought of a potentially better way to write `limitedRead`: pass
`limit+1` bytes to `io.LimitedReader`, and then return an error if either
`io.ReadAll` returns an error, or `len(p) == limit+1`. Basically, roll the
second read of 1 byte into the original read. If that works and it looks
better to you, that's good to merge as well.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/26348#comment:9>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list