Skip to content

Commit eee2e51

Browse files
committed
Fix plist_set_date_val to use correct size for data storage
Otherwise the internal assertion will trigger since the incorrect size will be checked against. Thanks to @michaelwright235, @guyingzhao, and others for pointing this out!
1 parent d031e94 commit eee2e51

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/plist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1548,7 +1548,7 @@ void plist_set_data_val(plist_t node, const char *val, uint64_t length)
15481548
void plist_set_date_val(plist_t node, int32_t sec, int32_t usec)
15491549
{
15501550
double val = (double)sec + (double)usec / 1000000;
1551-
plist_set_element_val(node, PLIST_DATE, &val, sizeof(struct timeval));
1551+
plist_set_element_val(node, PLIST_DATE, &val, sizeof(double));
15521552
}
15531553

15541554
int plist_bool_val_is_true(plist_t boolnode)

0 commit comments

Comments
 (0)