Skip to content

Commit 2f8f2bb

Browse files
committed
emsmdb: avoid providing garbage timestamp in pchgheader.PR_LAST_MODIFICATION_TIME
Fixes: gromox-2.18-71-gc66914b30
1 parent 19b55f8 commit 2f8f2bb

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

exch/emsmdb/icsdownctx_object.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -517,11 +517,14 @@ static BOOL icsdownctx_object_extract_msgctntinfo(MESSAGE_CONTENT *pmsgctnt,
517517
pchgheader->emplace_back(PR_SOURCE_KEY, bin);
518518
common_util_remove_propvals(&pmsgctnt->proplist, PR_SOURCE_KEY);
519519

520-
auto ts = pmsgctnt->proplist.get<const uint64_t>(PR_LAST_MODIFICATION_TIME);
521-
uint64_t now = rop_util_unix_to_nttime(time(nullptr));
522-
if (ts == nullptr)
520+
auto ts = pmsgctnt->proplist.get<uint64_t>(PR_LAST_MODIFICATION_TIME);
521+
if (ts == nullptr) {
522+
ts = cu_alloc<uint64_t>();
523+
if (ts == nullptr)
524+
return false;
523525
/* Faking it seems to work */
524-
ts = &now;
526+
*ts = rop_util_unix_to_nttime(time(nullptr));
527+
}
525528
pchgheader->emplace_back(PR_LAST_MODIFICATION_TIME, ts);
526529

527530
bin = pmsgctnt->proplist.get<BINARY>(PR_CHANGE_KEY);

0 commit comments

Comments
 (0)