[PATCH 15/30] Function pull_state cannot work with NULL buffer

Zdenek Kabelac <[email protected]>
Newsgroups dev.linux.lists.lvm-devel
Message-ID <abdcbbaa1bdc75655773af22a50db6ff0e1e8539.1287994530.git.zkabelac@redhat.com>
In practice this situation should not happen in current lvm code.

Signed-off-by: Zdenek Kabelac <[email protected]>
---
 daemons/cmirrord/functions.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/daemons/cmirrord/functions.c b/daemons/cmirrord/functions.c
index e5da757..58e76ac 100644
--- a/daemons/cmirrord/functions.c
+++ b/daemons/cmirrord/functions.c
@@ -1809,8 +1809,10 @@ int pull_state(const char *uuid, uint64_t luid,
 	int bitset_size;
 	struct log_c *lc;
 
-	if (!buf)
+	if (!buf) {
 		LOG_ERROR("pull_state: buf == NULL");
+		return -EINVAL;
+	}
 
 	lc = get_log(uuid, luid);
 	if (!lc) {
-- 
1.7.3.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.