HomeClusterLabs Projects

Fix: crm_simulate: Prevent segfault on arches with 64bit time_t

Description

Fix: crm_simulate: Prevent segfault on arches with 64bit time_t

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=<optimized out>, 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

Details

Provenance
gao-yanAuthored on Aug 5 2015, 2:43 PM
Parents
rPeefdc909a41b: Merge pull request #767 from HideoYamauchi/master
Branches
Unknown
Tags
Unknown

Event Timeline