Trac issueshttps://gitlab.torproject.org/legacy/trac/-/issues2020-06-13T14:25:37Zhttps://gitlab.torproject.org/legacy/trac/-/issues/7729Reading pending TLS bytes can take us over at_most2020-06-13T14:25:37ZNick MathewsonReading pending TLS bytes can take us over at_mostIn connection_read_to_buf(), after we fetch pending TLS bytes, we re-set 'result' to be the total number of bytes actually read. But later we do:
```
if (more_to_read && result == at_most) {
slack_in_buf = buf_slack(conn->inbuf);
...In connection_read_to_buf(), after we fetch pending TLS bytes, we re-set 'result' to be the total number of bytes actually read. But later we do:
```
if (more_to_read && result == at_most) {
slack_in_buf = buf_slack(conn->inbuf);
at_most = more_to_read;
goto again;
}
```
That's not good; 'result' can also be >= at_most, which might also mean that we should try reading more, maybe.
Reported pseudonymously; the reporter attached this patch. Possibly backportable to 0.2.3.Tor: unspecified