<feed xmlns='http://www.w3.org/2005/Atom'>
<title>libplist/src/time64.c, branch 2.8.1</title>
<subtitle>Library to handle Apple Property List format files in binary or XML</subtitle>
<link rel='alternate' type='text/html' href='https://cgit.sukimashita.com/libplist.git/'/>
<entry>
<title>time64: fix signed overflow for extreme years in gmtime64_r()</title>
<updated>2026-11-05T09:00:32+00:00</updated>
<author>
<name>Nikias Bassen</name>
</author>
<published>2026-11-05T09:00:32+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.sukimashita.com/libplist.git/commit/?id=51f471432715f7a1880d38c135ce41182b4dc78e'/>
<id>51f471432715f7a1880d38c135ce41182b4dc78e</id>
<content type='text'>
IS_LEAP() computed `tm_year + 1900` in int arithmetic, which overflows
for dates around year 2^31 (hit via check_tm() when writing dates).

Cast to Year (64-bit) in IS_LEAP(). Also make gmtime64_r() return NULL
with EOVERFLOW when the calendar year (tm_year + 1900) does not fit in
an int; the previous check compared tm_year with itself and could never
fail. This avoids strftime() wrapping the year in the output, and
callers fall back to their existing default date string.

Credit to OSSFuzz
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
IS_LEAP() computed `tm_year + 1900` in int arithmetic, which overflows
for dates around year 2^31 (hit via check_tm() when writing dates).

Cast to Year (64-bit) in IS_LEAP(). Also make gmtime64_r() return NULL
with EOVERFLOW when the calendar year (tm_year + 1900) does not fit in
an int; the previous check compared tm_year with itself and could never
fail. This avoids strftime() wrapping the year in the output, and
callers fall back to their existing default date string.

Credit to OSSFuzz
</pre>
</div>
</content>
</entry>
<entry>
<title>time64: Add time_s support for WIN32</title>
<updated>2026-01-22T12:26:30+00:00</updated>
<author>
<name>Rosen Penev</name>
</author>
<published>2026-01-16T02:06:49+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.sukimashita.com/libplist.git/commit/?id=287e7e7fd6f221985a325bef66b8a81e8dda1062'/>
<id>287e7e7fd6f221985a325bef66b8a81e8dda1062</id>
<content type='text'>
Signed-off-by: Rosen Penev &lt;rosenp@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Rosen Penev &lt;rosenp@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>time64: Assert if date is pointing to NULL</title>
<updated>2025-10-29T15:33:48+00:00</updated>
<author>
<name>Nikias Bassen</name>
</author>
<published>2025-10-29T15:31:30+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.sukimashita.com/libplist.git/commit/?id=b5a9af880ffbdd5f310a2cd04c41cc86daac20cd'/>
<id>b5a9af880ffbdd5f310a2cd04c41cc86daac20cd</id>
<content type='text'>
Given the fact that timegm64 is only invoked with a valid pointer,
this should never trigger.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Given the fact that timegm64 is only invoked with a valid pointer,
this should never trigger.
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-tidy] Fix bad widening casts</title>
<updated>2021-06-21T23:27:02+00:00</updated>
<author>
<name>Rosen Penev</name>
</author>
<published>2020-12-22T04:52:51+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.sukimashita.com/libplist.git/commit/?id=526c10436caa894fb6139f4e6c0f73eebfa858ea'/>
<id>526c10436caa894fb6139f4e6c0f73eebfa858ea</id>
<content type='text'>
Found with bugprone-misplaced-widening-cast

Signed-off-by: Rosen Penev &lt;rosenp@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Found with bugprone-misplaced-widening-cast

Signed-off-by: Rosen Penev &lt;rosenp@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-tidy] Avoid global non-const variables</title>
<updated>2021-06-21T23:11:06+00:00</updated>
<author>
<name>Rosen Penev</name>
</author>
<published>2020-12-22T03:55:06+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.sukimashita.com/libplist.git/commit/?id=904cbea78fb91438eafc867ccd8a9f9ab66eb5ec'/>
<id>904cbea78fb91438eafc867ccd8a9f9ab66eb5ec</id>
<content type='text'>
Found with cppcoreguidelines-avoid-non-const-global-variables

Signed-off-by: Rosen Penev &lt;rosenp@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Found with cppcoreguidelines-avoid-non-const-global-variables

Signed-off-by: Rosen Penev &lt;rosenp@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>time64: Remove code duplication in separate if branches by combining the conditions</title>
<updated>2020-11-24T00:25:10+00:00</updated>
<author>
<name>Rosen Penev</name>
</author>
<published>2020-06-08T05:22:18+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.sukimashita.com/libplist.git/commit/?id=275cecdfc39641c692128c50b622c902cd1230f3'/>
<id>275cecdfc39641c692128c50b622c902cd1230f3</id>
<content type='text'>
[clang-tidy] Found with bugprone-branch-clone

Signed-off-by: Rosen Penev &lt;rosenp@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[clang-tidy] Found with bugprone-branch-clone

Signed-off-by: Rosen Penev &lt;rosenp@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Improve code readability by not using else after return</title>
<updated>2020-11-24T00:06:31+00:00</updated>
<author>
<name>Rosen Penev</name>
</author>
<published>2020-06-08T04:48:10+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.sukimashita.com/libplist.git/commit/?id=9f60cdd76b6044931cc2f2b6f2fbec3deb67a425'/>
<id>9f60cdd76b6044931cc2f2b6f2fbec3deb67a425</id>
<content type='text'>
[clang-tidy] Found with readability-else-after-return

Signed-off-by: Rosen Penev &lt;rosenp@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[clang-tidy] Found with readability-else-after-return

Signed-off-by: Rosen Penev &lt;rosenp@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove whitespace errors from all files</title>
<updated>2020-06-08T20:47:19+00:00</updated>
<author>
<name>Martin Szulecki</name>
</author>
<published>2020-06-08T20:47:19+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.sukimashita.com/libplist.git/commit/?id=5ca510afde8bc59c9682f5f1ae11b1ed74d1acdd'/>
<id>5ca510afde8bc59c9682f5f1ae11b1ed74d1acdd</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>time64: Silence compiler warnings about shadowed variable declarations</title>
<updated>2020-05-14T17:22:07+00:00</updated>
<author>
<name>Nikias Bassen</name>
</author>
<published>2020-05-14T17:22:07+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.sukimashita.com/libplist.git/commit/?id=bbde6a4ac4c1cd0abad294b7533d01ab5b230880'/>
<id>bbde6a4ac4c1cd0abad294b7533d01ab5b230880</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>time64/ctime64_r: localtime64_r can fail</title>
<updated>2020-04-22T00:19:24+00:00</updated>
<author>
<name>Derrick Lyndon Pallas</name>
</author>
<published>2020-04-22T00:01:27+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.sukimashita.com/libplist.git/commit/?id=b1c9fda74be24a69443f45d4470cbe14f69fe860'/>
<id>b1c9fda74be24a69443f45d4470cbe14f69fe860</id>
<content type='text'>
In ctime64_r, the call to localtime64_r can fail.  If we don't check for
this and then call asctime64_r, the results are garbage.

Signed-off-by: Derrick Lyndon Pallas &lt;derrick@pallas.us&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In ctime64_r, the call to localtime64_r can fail.  If we don't check for
this and then call asctime64_r, the results are garbage.

Signed-off-by: Derrick Lyndon Pallas &lt;derrick@pallas.us&gt;
</pre>
</div>
</content>
</entry>
</feed>
