Skip to content

Commit ad8cb16

Browse files
keys: encrypted-type: Replace zero-length array with flexible-array
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] KSPP/linux#21 Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
1 parent 50b6951 commit ad8cb16

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎include/keys/encrypted-type.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct encrypted_key_payload {
2727
unsigned short payload_datalen; /* payload data length */
2828
unsigned short encrypted_key_format; /* encrypted key format */
2929
u8 *decrypted_data; /* decrypted data */
30-
u8 payload_data[0]; /* payload data + datablob + hmac */
30+
u8 payload_data[]; /* payload data + datablob + hmac */
3131
};
3232

3333
extern struct key_type key_type_encrypted;

0 commit comments

Comments
 (0)