mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
find_key_by_type_and_desc must return 0 on error.
This commit is contained in:
@@ -150,7 +150,11 @@ static key_serial_t find_key_by_type_and_desc(const char *type, const char *desc
|
|||||||
do {
|
do {
|
||||||
id = request_key(type, desc, NULL, 0);
|
id = request_key(type, desc, NULL, 0);
|
||||||
} while (id < 0 && errno == EINTR);
|
} while (id < 0 && errno == EINTR);
|
||||||
if (id >= 0 || errno == ENOMEM)
|
|
||||||
|
if (id < 0 && errno == ENOMEM)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (id >= 0)
|
||||||
return id;
|
return id;
|
||||||
|
|
||||||
f = open("/proc/keys", O_RDONLY);
|
f = open("/proc/keys", O_RDONLY);
|
||||||
|
|||||||
Reference in New Issue
Block a user