Skip to content

Commit

Permalink
Use concrete type to fix a potential soundness issue
Browse files Browse the repository at this point in the history
Fixes #19
  • Loading branch information
urschrei committed Jul 3, 2023
1 parent c66eca1 commit f1c4f05
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "lonlat_bng"
description = "Convert longitude and latitude coordinates to BNG coordinates, and vice versa"
version = "0.6.32"
version = "0.6.33"
authors = ["Stephan Hügel <urschrei@gmail.com>"]
license = "MIT"
keywords = ["OSGB36", "BNG", "Geo", "ETRS89", "OSTN02", "OSTN15"]
Expand All @@ -17,7 +17,7 @@ criterion = "0.4.0"
cbindgen = "0.24.2"

[dependencies]
libc = "0.2.139"
libc = "0.2.147"
rand = "0.8.5"
ostn15_phf = { git = "https://github.com/urschrei/ostn15_phf.git" }
rayon = "1.7.0"
Expand Down
6 changes: 3 additions & 3 deletions src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ pub extern "C" fn drop_float_array(lons: Array, lats: Array) {
let _: &mut [f64] = lats.into();
}

// Build an Array from &mut[T], so it can be leaked across the FFI boundary
impl<'a, T> From<&'a mut [T]> for Array {
fn from(sl: &mut [T]) -> Self {
// Build an Array so it can be leaked across the FFI boundary
impl<'a> From<&'a mut [f64]> for Array {
fn from(sl: &mut [f64]) -> Self {
Array {
data: sl.as_mut_ptr().cast::<libc::c_void>(),
len: sl.len() as libc::size_t,
Expand Down

0 comments on commit f1c4f05

Please sign in to comment.