From 0a170efaa5ee9a1df824630db2a997ad52f6ef57 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Wed, 11 Apr 2018 18:21:29 +0200 Subject: [PATCH] fixed unsafe shell call on windows (#8372) --- parity/url.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/parity/url.rs b/parity/url.rs index 9b8959f01..4189ae241 100644 --- a/parity/url.rs +++ b/parity/url.rs @@ -23,12 +23,14 @@ pub fn open(url: &str) { use winapi::um::shellapi::ShellExecuteA; use winapi::um::winuser::SW_SHOWNORMAL as Normal; - ShellExecuteA(ptr::null_mut(), - CString::new("open").unwrap().as_ptr(), - CString::new(url.to_owned().replace("\n", "%0A")).unwrap().as_ptr(), - ptr::null(), - ptr::null(), - Normal); + unsafe { + ShellExecuteA(ptr::null_mut(), + CString::new("open").unwrap().as_ptr(), + CString::new(url.to_owned().replace("\n", "%0A")).unwrap().as_ptr(), + ptr::null(), + ptr::null(), + Normal); + } } #[cfg(any(target_os="macos", target_os="freebsd"))]