1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvmetad: do not deref NULL pointer

Call log only for req.cft != NULL.
This commit is contained in:
Zdenek Kabelac 2012-08-23 11:01:00 +02:00
parent 3685701529
commit ed53b4b674
2 changed files with 4 additions and 1 deletions

View File

@ -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.

View File

@ -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. */