[tor-bugs] #7729 [Tor]: Reading pending TLS bytes can take us over at_most

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Dec 14 18:05:02 UTC 2012


#7729: Reading pending TLS bytes can take us over at_most
-----------------------+----------------------------------------------------
 Reporter:  nickm      |          Owner:                    
     Type:  defect     |         Status:  new               
 Priority:  normal     |      Milestone:  Tor: 0.2.4.x-final
Component:  Tor        |        Version:                    
 Keywords:  tor-relay  |         Parent:                    
   Points:             |   Actualpoints:                    
-----------------------+----------------------------------------------------
 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.

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/7729>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list