summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2012-08-23 11:01:00 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2012-08-23 14:34:54 +0200
commited53b4b6740973411acee52a31fca9c48c585dab (patch)
tree6c9ea5692d064495e9c249e028db0dd3293bd3ce
parent3685701529e0d25a17a7fd7874e276fc441cad7c (diff)
downloadlvm2-ed53b4b6740973411acee52a31fca9c48c585dab.zip
lvm2-ed53b4b6740973411acee52a31fca9c48c585dab.tar.gz
lvm2-ed53b4b6740973411acee52a31fca9c48c585dab.tar.xz
lvmetad: do not deref NULL pointer
Call log only for req.cft != NULL.
-rw-r--r--WHATS_NEW1
-rw-r--r--libdaemon/server/daemon-server.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index dc3b29e..1dcc5c2 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.98
=================================
+ Fix dereference of NULL in lvmetad error path logging.
Fix buffer memory leak in lvmetad logging.
Use 'ignore' discards for thin metadata created with older versions.
Use proper condition to check for unsupported discards settings.
diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
index 27a3a05..df75ac7 100644
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -389,10 +389,12 @@ static void *client_thread(void *baton)
goto fail;
req.cft = dm_config_from_string(req.buffer);
+
if (!req.cft)
fprintf(stderr, "error parsing request:\n %s\n", req.buffer);
+ else
+ daemon_log_cft(b->s.log, DAEMON_LOG_WIRE, "<- ", req.cft->root);
- daemon_log_cft(b->s.log, DAEMON_LOG_WIRE, "<- ", req.cft->root);
res = builtin_handler(b->s, b->client, req);
if (res.error == EPROTO) /* Not a builtin, delegate to the custom handler. */