diff options
-rw-r--r-- | WHATS_NEW | 1 | ||||
-rw-r--r-- | daemons/clvmd/clvmd-command.c | 3 |
2 files changed, 3 insertions, 1 deletions
@@ -1,5 +1,6 @@ Version 2.02.78 - ==================================== + Check reallocated buffer for NULL before use in clvmd do_command(). Fix memory leak when VG allocation policy in metadata is invalid. Ignore unrecognised allocation policy found in metadata instead of aborting. Factor out tag printing into _out_tags and avoid leaking string buffer. diff --git a/daemons/clvmd/clvmd-command.c b/daemons/clvmd/clvmd-command.c index 3500ca5d..8d1dcff5 100644 --- a/daemons/clvmd/clvmd-command.c +++ b/daemons/clvmd/clvmd-command.c @@ -169,7 +169,8 @@ int do_command(struct local_client *client, struct clvm_header *msg, int msglen, /* Check the status of the command and return the error text */ if (status) { - *retlen = 1 + snprintf(*buf, buflen, "%s", strerror(status)); + *retlen = 1 + (*buf) ? snprintf(*buf, buflen, "%s", + strerror(status)) : -1; } return status; |