diff options
| author | 2026-05-22 19:20:51 +0200 | |
|---|---|---|
| committer | 2026-05-22 19:20:51 +0200 | |
| commit | ba82092e43d4769dbc6f0557d58a243f93542486 (patch) | |
| tree | 4054d7d4b701207f6a7def2799295557c5fdf68d /src/common.h | |
| parent | 9711459dbed7d60bb00c7d2c052623e8489c88e1 (diff) | |
| download | libplist-ba82092e43d4769dbc6f0557d58a243f93542486.tar.gz libplist-ba82092e43d4769dbc6f0557d58a243f93542486.tar.bz2 | |
common: validate PLIST_DATE values before Time64_T conversion
Avoid undefined behavior when serializing malformed PLIST_DATE values
containing NaN, infinity, or values outside the Time64_T range. Add a
shared helper for checked date conversion and use it across writer paths.
Diffstat (limited to 'src/common.h')
| -rw-r--r-- | src/common.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h index 7e5aff7..ffaa78c 100644 --- a/src/common.h +++ b/src/common.h @@ -22,11 +22,13 @@ #define COMMON_H #include <stddef.h> +#include "time64.h" #define MAC_EPOCH 978307200 size_t dtostr(char *buf, size_t bufsize, double realval); int num_digits_i(int64_t i); int num_digits_u(uint64_t i); +int plist_real_to_time64(double realval, Time64_T *timev); #endif |
