mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-13 20:00:08 +01:00
Fix scan-build warning (null use).
Probably false positive but defensive approach is better here.
This commit is contained in:
@@ -187,6 +187,9 @@ static int crypt_cipher_crypt(struct crypt_cipher *ctx,
|
|||||||
|
|
||||||
/* Set encrypt/decrypt operation */
|
/* Set encrypt/decrypt operation */
|
||||||
header = CMSG_FIRSTHDR(&msg);
|
header = CMSG_FIRSTHDR(&msg);
|
||||||
|
if (!header)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
header->cmsg_level = SOL_ALG;
|
header->cmsg_level = SOL_ALG;
|
||||||
header->cmsg_type = ALG_SET_OP;
|
header->cmsg_type = ALG_SET_OP;
|
||||||
header->cmsg_len = CMSG_LEN(sizeof(*type));
|
header->cmsg_len = CMSG_LEN(sizeof(*type));
|
||||||
|
|||||||
Reference in New Issue
Block a user