diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-01-04 12:20:54 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-01-04 12:21:55 -0500 |
commit | 1dab8bae21bc32e5d4e3ff954f4919d6506ad2e1 (patch) | |
tree | 5bf70e6e8c0c67908ae2307335c54c1cd485cc19 /src/rust | |
parent | e0ccec219b5dae32a6c469f01a615509e61dbc5e (diff) | |
download | tor-1dab8bae21bc32e5d4e3ff954f4919d6506ad2e1.tar.gz tor-1dab8bae21bc32e5d4e3ff954f4919d6506ad2e1.zip |
smartlist.rs: The libc::c_char type is not the same as i8.
The code had been using c_char and i8 interchangeably, but it turns
out that c_char is only i8 on platforms where "char" is signed. On
other platforms, c_char is u8.
Fixes bug 24794; bug not on any released Tor.
Diffstat (limited to 'src/rust')
-rw-r--r-- | src/rust/smartlist/smartlist.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rust/smartlist/smartlist.rs b/src/rust/smartlist/smartlist.rs index ec5d7a57f5..2a822d89f4 100644 --- a/src/rust/smartlist/smartlist.rs +++ b/src/rust/smartlist/smartlist.rs @@ -33,7 +33,7 @@ impl Smartlist<String> for Stringlist { // unsafe, as we need to extract the smartlist list into a vector of // pointers, and then transform each element into a Rust string. - let elems: &[*const i8] = + let elems: &[*const c_char] = unsafe { slice::from_raw_parts(self.list, self.num_used as usize) }; for elem in elems.iter() { |