Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audit iana-time-zone #79

Open
pinkforest opened this issue Sep 27, 2022 · 1 comment
Open

Audit iana-time-zone #79

pinkforest opened this issue Sep 27, 2022 · 1 comment

Comments

@pinkforest
Copy link

As described: strawlab/iana-time-zone#64

This crate is now used by chrono and has become very important in the ecosystem

All these blocks seem documented

$ naive grep -R unsafe *

src/tz_android.rs:    let key = unsafe { CStr::from_bytes_with_nul_unchecked(b"persist.sys.timezone\0") };
src/tz_android.rs:        unsafe { PROPERTIES = Some(properties) };
src/tz_android.rs:    unsafe { PROPERTIES.as_ref() }
src/tz_windows.rs:    unsafe { Ok(get_timezone()?) }
src/tz_windows.rs:unsafe fn get_timezone() -> Result<String, HRESULT> {
src/tz_windows.rs:unsafe fn initialize_factory() {
src/tz_windows.rs:            unsafe { WindowsDeleteString(string) };
src/tz_windows.rs:            unsafe { (*(instance as *mut IUnknown)).Release() };
src/tz_macos.rs:    unsafe { get_timezone().ok_or(crate::GetTimezoneError::OsError) }
src/tz_macos.rs:unsafe fn get_timezone() -> Option<String> {
src/tz_macos.rs:        unsafe { CFRelease(self.0 as CFTypeRef) };
src/tz_macos.rs:    unsafe fn new(v: *const T) -> Option<Self> {
@lopopolo
Copy link

@pinkforest since you've expressed interest in this, just giving you and the safety dance team a heads up that we've significantly refactored the macOS internals if y'all are interested in taking a look. We're gonna let this PR sit until October 6 before merging it:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants