HomeClusterLabs Projects

High: tools: Fix a segfault in error handling in crm_resource.

This commit no longer exists in the repository. It may have been part of a branch which was deleted.

Description

High: tools: Fix a segfault in error handling in crm_resource.

First, we need to allocate the right amount of memory for printing error
messages. Add space for the initial "non-option..." string and another
space for the NULL terminator on a string vector.

I think what happened here is that the "non-option..." string is not
terminated with a newline, making it appear as if it is the same string
as the first extra command line parameter string. However, it does
actually take up its own slot in the string vector and so needs a slot
allocated for it.

So while I'm at it, add the newline back in. It appears to have been
incorrectly removed when crm_resource was converted to using GError
instead of CMD_ERR.

Fixes T522
See: clbz#5496

Details

Provenance
clumensAuthored on Jul 18 2022, 1:55 PM
Tasks
Restricted Maniphest Task

Commit No Longer Exists

This commit no longer exists in the repository.