[tor-bugs] #5105 [Tor Bridge]: set_managed_proxy_environment should be OS-independent

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Wed Feb 15 18:06:46 UTC 2012


#5105: set_managed_proxy_environment should be OS-independent
------------------------+---------------------------------------------------
 Reporter:  rransom     |          Owner:                    
     Type:  defect      |         Status:  needs_revision    
 Priority:  major       |      Milestone:  Tor: 0.2.3.x-final
Component:  Tor Bridge  |        Version:                    
 Keywords:              |         Parent:                    
   Points:              |   Actualpoints:                    
------------------------+---------------------------------------------------

Comment(by nickm):

 Replying to [comment:5 rransom]:
 > Replying to [comment:3 nickm]:
 > >  * Technically, calloc(0,0)  should be legal -- or at the very least,
 it shouldn't be a divide-by-zero error.
 >
 > Oops.

 (Actually, to be scrupulous, calloc(0,0) isn't required to be legal
 because of any C standard, but for consistency with tor_malloc(0).)

 > > wrt later stuff:
 > >
 > >  * Maybe it would be easier to have
 get_current_process_environment_variables() return a list containing heap-
 allocated copies of the environment variables?  That way we wouldn't need
 so much bookkeeping to remember what was safe to free and what wasn't, and
 we could eliminate the possibility of an entire category of error.
 >
 > But this way is faster!

 Faster but trickier and more error-prone.  If this ever shows up in a
 profile, we have done something terribly wrong.

 Friends don't let friends optimize outside the critical path. ;)

 > I'll make this change the next time I touch this branch, although we
 might want a non-`strdup`-ing version of
 `get_current_process_environment_variables` someday.
 >
 > > In general:
 > >
 > >  * Yeah, some unit tests would be great.

 --

 Are you working on changes here, or should somebody else pick up the
 revisions?

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


More information about the tor-bugs mailing list