return correct key description format in dm_query_device

dm_query_device is expected to return kernel key description
string only. By mistake the code returned also type in head
of key description.
This commit is contained in:
Ondrej Kozina
2017-09-19 14:53:17 +02:00
committed by Milan Broz
parent c3a0cbfc85
commit c34bee2009

View File

@@ -1272,7 +1272,7 @@ static int _dm_query_crypt(uint32_t get_flags,
if (get_flags & DM_ACTIVE_CRYPT_KEY) {
if (key_[0] == ':') {
dmd->u.crypt.key_description = strdup(strpbrk(key_ + 1, ":") + 1);
dmd->u.crypt.key_description = strdup(strpbrk(strpbrk(key_ + 1, ":") + 1, ":") + 1);
if (!dmd->u.crypt.key_description) {
r = -ENOMEM;
goto err;