fix(napi): add missing nul byte to noop

Fixes a global-buffer-overflow bug
This commit is contained in:
messense 2022-01-22 11:59:28 +08:00
parent 6a83c21e0c
commit a109c54918

View file

@ -334,7 +334,7 @@ pub(crate) unsafe extern "C" fn noop(
sys::napi_throw_error( sys::napi_throw_error(
env, env,
ptr::null_mut(), ptr::null_mut(),
CStr::from_bytes_with_nul_unchecked(b"Class contains no `constructor`, can not new it!") CStr::from_bytes_with_nul_unchecked(b"Class contains no `constructor`, can not new it!\0")
.as_ptr(), .as_ptr(),
); );
} }