HomeClusterLabs Projects

crm_resource --list-agents: don't print uninitialized memory

Description

crm_resource --list-agents: don't print uninitialized memory

When the first character of the argument is a colon, the original code
printed uninitialized memory, because sscanf returned 0. For example:

$ /usr/sbin/crm_resource --list-agents=:
No agents found for standard=øDÀ, provider=

This patch avoids using arbitrarily sized buffers, and separates
standard and provider by changing argv through the optarg pointer.

Signed-off-by: Ferenc Wágner <wferi@niif.hu>

Details

Provenance
Ferenc Wágner <wferi@niif.hu>Authored on Jan 4 2016, 9:43 PM
Parents
rPe0ba29d0f97f: Merge pull request #877 from wferi/typo-and-build-fixes
Branches
Unknown
Tags
Unknown

Event Timeline