[tor-bugs] #25127 [Core Tor/Tor]: Rust implementation of protover_get_supported_protocols() leaks memory
    Tor Bug Tracker & Wiki 
    blackhole at torproject.org
       
    Mon Feb  5 23:08:31 UTC 2018
    
    
  
#25127: Rust implementation of protover_get_supported_protocols() leaks memory
----------------------------------+------------------------------------
 Reporter:  nickm                 |          Owner:  isis
     Type:  defect                |         Status:  assigned
 Priority:  Medium                |      Milestone:  Tor: 0.3.3.x-final
Component:  Core Tor/Tor          |        Version:
 Severity:  Normal                |     Resolution:
 Keywords:  rust, protover, leak  |  Actual Points:
Parent ID:                        |         Points:
 Reviewer:                        |        Sponsor:
----------------------------------+------------------------------------
Changes (by isis):
 * owner:  (none) => isis
 * status:  new => assigned
Comment:
 I believe the fix is changing to doing
 {{{
 use std::ffi::CStr;
 const C_COMPATIBLE_AND_LIVES_FOREVER: &'static CStr =
 CStr.from_bytes_with_nul_unchecked(b"STUFF GOES HERE\0");
 }}}
 and then passing to C with
 `tor_c_function(C_COMPATIBLE_AND_LIVES_FOREVER.as_ptr())`.
 I'll go patch it and valgrind it for leaks.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/25127#comment:10>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
    
    
More information about the tor-bugs
mailing list