Loading changes/bug27804 0 → 100644 +3 −0 Original line number Diff line number Diff line o Minor bugfixes (rust): - Fix a potential null dereference in protover_all_supported(). Add a test for it. Fixes bug 27804; bugfix on 0.3.3.1-alpha. src/rust/protover/ffi.rs +3 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,9 @@ pub extern "C" fn protover_all_supported( if maybe_unsupported.is_some() { let unsupported: UnvalidatedProtoEntry = maybe_unsupported.unwrap(); if missing_out.is_null() { return 0; } let c_unsupported: CString = match CString::new(unsupported.to_string()) { Ok(n) => n, Err(_) => return 1, Loading src/test/test_protover.c +1 −0 Original line number Diff line number Diff line Loading @@ -259,6 +259,7 @@ test_protover_all_supported(void *arg) tt_ptr_op(msg, OP_EQ, NULL); // Some things we don't support tt_assert(! protover_all_supported("Wombat=9", NULL)); tt_assert(! protover_all_supported("Wombat=9", &msg)); tt_str_op(msg, OP_EQ, "Wombat=9"); tor_free(msg); Loading Loading
changes/bug27804 0 → 100644 +3 −0 Original line number Diff line number Diff line o Minor bugfixes (rust): - Fix a potential null dereference in protover_all_supported(). Add a test for it. Fixes bug 27804; bugfix on 0.3.3.1-alpha.
src/rust/protover/ffi.rs +3 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,9 @@ pub extern "C" fn protover_all_supported( if maybe_unsupported.is_some() { let unsupported: UnvalidatedProtoEntry = maybe_unsupported.unwrap(); if missing_out.is_null() { return 0; } let c_unsupported: CString = match CString::new(unsupported.to_string()) { Ok(n) => n, Err(_) => return 1, Loading
src/test/test_protover.c +1 −0 Original line number Diff line number Diff line Loading @@ -259,6 +259,7 @@ test_protover_all_supported(void *arg) tt_ptr_op(msg, OP_EQ, NULL); // Some things we don't support tt_assert(! protover_all_supported("Wombat=9", NULL)); tt_assert(! protover_all_supported("Wombat=9", &msg)); tt_str_op(msg, OP_EQ, "Wombat=9"); tor_free(msg); Loading