HomeClusterLabs Projects

Fix: crm_mon: protect against non-standard or failing asctime

Description

Fix: crm_mon: protect against non-standard or failing asctime

So far, we have been likely covered by standards requiring asctime to
produce an output ending with \n\0 bytes, because otherwise, we would
overrun the buffer, reading unspecified content, possibly segfaulting.
This was actually discovered with a brand new GCC7 warning
( [-Werror=pointer-compare]).

Another latent issue was that the code was not ready for the case
of failing asctime call (returning NULL). This is now fixed as well.

Details

Provenance
Jan Pokorny <jpokorny@redhat.com>Authored on Feb 2 2017, 8:51 AM
Jan Pokorný <jpokorny@redhat.com>Committed on Feb 2 2017, 9:04 AM
Parents
rPb8118218c0dc: Merge pull request #1216 from jnpkrn/libservices
Branches
Unknown
Tags
Unknown

Event Timeline