-
Notifications
You must be signed in to change notification settings - Fork 48
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
Error message using feature timestamp #44
Labels
CVE-2020-26235
Unsound behaviour with local timezone access
Comments
Ok I think I get it: /// Obtain the system's UTC offset.
#[cfg(any(target_os = "linux", target_os = "freebsd", unsound_local_offset))]
pub(super) fn local_offset_at(datetime: OffsetDateTime) -> Option<UtcOffset> {
// Ensure that the process is single-threaded unless the user has explicitly opted out of this
// check. This is to prevent issues with the environment being mutated by a different thread in
// the process while execution of this function is taking place, which can cause a segmentation
// fault by dereferencing a dangling pointer.
if !cfg!(unsound_local_offset) && num_threads::is_single_threaded() != Some(true) {
return None;
}
// Safety: We have just confirmed that the process is single-threaded or the user has explicitly
// opted out of soundness.
let tm = unsafe { timestamp_to_tm(datetime.unix_timestamp()) }?;
tm_to_offset(tm)
} https://time-rs.github.io/internal-api/time/sys/local_offset_at/imp/fn.timestamp_to_tm.html |
There's some more information on this issue: #43 |
borntyping
added a commit
that referenced
this issue
Dec 14, 2021
borntyping
added a commit
that referenced
this issue
Dec 14, 2021
Released v1.16.0 with options to use UTC timestamps. Thanks! |
This was referenced Jan 19, 2022
UTC timestamps are now the default in simple_logger 2.0.0. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello Sam,
I have the following message compiling my program.
I try to activate the threads feature, but I still get the error message below.
Of course, if I disable the timestamp feature, it works.
Could you advise how to fix this issue as it appears unclear to me ?
The text was updated successfully, but these errors were encountered: