Skip to content

Commit 8698f51

Browse files
4TT1L4ovr
authored andcommitted
[SEC] RUSTSEC-2023-0020: const-cstr is Unmaintained rust-rocksdb#914
1 parent f9bfe3d commit 8698f51

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

librocksdb-sys/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ libz-sys = { version = "1.1", default-features = false, optional = true }
3333
bzip2-sys = { version = "0.1", default-features = false, optional = true }
3434

3535
[dev-dependencies]
36-
const-cstr = "0.3"
3736
uuid = { version = "1.0", features = ["v4"] }
3837

3938
[build-dependencies]

librocksdb-sys/tests/ffi.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
unused_variables
2424
)]
2525

26-
use const_cstr::const_cstr;
2726
use libc::*;
2827
use librocksdb_sys::*;
2928
use std::borrow::Cow;
@@ -41,7 +40,11 @@ macro_rules! err_println {
4140
}
4241

4342
macro_rules! cstrp {
44-
($($arg:tt)*) => (const_cstr!($($arg)*).as_ptr());
43+
($s:expr) => {{
44+
static CSTR: &CStr =
45+
unsafe { CStr::from_bytes_with_nul_unchecked(concat!($s, "\0").as_bytes()) };
46+
CSTR.as_ptr()
47+
}};
4548
}
4649

4750
static mut phase: &'static str = "";

0 commit comments

Comments
 (0)