tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit 4b6b58ed8ec6f5870bf5825e0013339f0223fa06
parent a9db07f3253bb7db23c05fbe0e01ff424a5a45a1
Author: Nick Mathewson <nickm@torproject.org>
Date:   Thu, 15 Nov 2018 16:11:06 -0500

Merge branch 'bug27740_035_fix' into maint-0.3.5

Diffstat:
Msrc/rust/protover/ffi.rs | 8+-------
1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/rust/protover/ffi.rs b/src/rust/protover/ffi.rs @@ -7,7 +7,6 @@ use libc::{c_char, c_int, uint32_t}; use std::ffi::CStr; -use std::ffi::CString; use smartlist::*; use tor_allocate::allocate_and_copy_string; @@ -65,12 +64,7 @@ pub extern "C" fn protover_all_supported( if missing_out.is_null() { return 0; } - let c_unsupported: CString = match CString::new(unsupported.to_string()) { - Ok(n) => n, - Err(_) => return 1, - }; - - let ptr = c_unsupported.into_raw(); + let ptr = allocate_and_copy_string(&unsupported.to_string()); unsafe { *missing_out = ptr }; return 0;