summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-10-30 09:34:04 -0400
committerNick Mathewson <nickm@torproject.org>2018-10-30 09:34:04 -0400
commitcf2cb783b77bf9a84c6485b492ebb7e09914b74f (patch)
tree8f92eb578516e9d4d7a02e6f875707879df34dde
parentc4b6b573880ba3f4806fed09e20ff384b556e277 (diff)
parent038bc21f8894043fbdda0cc87adddfbad84f65c4 (diff)
downloadtor-cf2cb783b77bf9a84c6485b492ebb7e09914b74f.tar.gz
tor-cf2cb783b77bf9a84c6485b492ebb7e09914b74f.zip
Merge branch 'maint-0.3.3' into maint-0.3.4
-rw-r--r--changes/bug277415
-rw-r--r--src/rust/protover/ffi.rs13
2 files changed, 9 insertions, 9 deletions
diff --git a/changes/bug27741 b/changes/bug27741
new file mode 100644
index 0000000000..531e264b63
--- /dev/null
+++ b/changes/bug27741
@@ -0,0 +1,5 @@
+ o Minor bugfixes (rust, directory authority):
+ - Fix an API mismatch in the rust implementation of
+ protover_compute_vote(). This bug could have caused crashes on any
+ directory authorities running Tor with Rust (which we do not yet
+ recommend). Fixes bug 27741; bugfix on 0.3.3.6.
diff --git a/src/rust/protover/ffi.rs b/src/rust/protover/ffi.rs
index 857a6968af..7386e988c5 100644
--- a/src/rust/protover/ffi.rs
+++ b/src/rust/protover/ffi.rs
@@ -190,8 +190,7 @@ pub extern "C" fn protover_get_supported_protocols() -> *const c_char {
#[no_mangle]
pub extern "C" fn protover_compute_vote(
list: *const Stringlist,
- threshold: c_int,
- allow_long_proto_names: bool,
+ threshold: c_int
) -> *mut c_char {
if list.is_null() {
@@ -206,13 +205,9 @@ pub extern "C" fn protover_compute_vote(
let mut proto_entries: Vec<UnvalidatedProtoEntry> = Vec::new();
for datum in data {
- let entry: UnvalidatedProtoEntry = match allow_long_proto_names {
- true => match UnvalidatedProtoEntry::from_str_any_len(datum.as_str()) {
- Ok(n) => n,
- Err(_) => continue},
- false => match datum.parse() {
- Ok(n) => n,
- Err(_) => continue},
+ let entry: UnvalidatedProtoEntry = match datum.parse() {
+ Ok(n) => n,
+ Err(_) => continue
};
proto_entries.push(entry);
}