Fix: crm_simulate: Prevent segfault on arches with 64bit time_t #769
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
on an s390x system:
Program terminated with signal SIGSEGV, Segmentation fault.
#0 ha_set_tm_time (source=0x0, target=0xb188f960) at iso8601.c:1004
1004 if (source->tm_year > 0) {
(gdb) bt
#0 ha_set_tm_time (source=0x0, target=0xb188f960) at iso8601.c:1004
#1 crm_time_set_timet (target=0xb188f960, source=source@entry=0x3ffffa670a0) at iso8601.c:1037
#2 0x0000000080004f26 in get_date (data_set=0x3ffffa67218, data_set=0x3ffffa67218) at crm_simulate.c:72
#3 0x0000000080003d20 in main (argc=, argv=0x3ffffa67538) at crm_simulate.c:789
This commit fixes the cast in get_date() which would result in incorrect
values for arches with 64bit time_t