[libcxx-commits] [libcxx] [libc++][chrono] Loads leap-seconds.list in tzdb. (PR #82113)
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Mar 27 12:47:25 PDT 2024
================
@@ -622,6 +623,36 @@ static void __parse_tzdata(tzdb& __db, __tz::__rules_storage_type& __rules, istr
}
}
+static void __parse_leap_seconds(vector<leap_second>& __leap_seconds, istream&& __input) {
+ // The file stores dates since 1 January 1900, 00:00:00, we want
+ // seconds since 1 January 1970.
+ constexpr auto __offset = sys_days{1970y / January / 1} - sys_days{1900y / January / 1};
+
----------------
mordante wrote:
By default the database is only writable by the root user. When having root access there are easier ways to do evil things.
I like the suggestion of adding fuzz tests. (I have that on my todo list for format too.) Unfortunately I'm not sure what the status of our fuzz testers is. @philnik777 was working on fixing them a while back.
https://github.com/llvm/llvm-project/pull/82113
More information about the libcxx-commits
mailing list