From 69b34d1b8af1df39bd0e81c92fb85e6c839f1ed6 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Mon, 27 Apr 2020 18:44:02 +1000 Subject: [PATCH] gss: fix signedness on is_initiator bitfield In SAnon: The is_initiator bitfield must be unsigned to avoid undefined behaviour, as there is only a single bit defined. Thanks to Nico Williams for explaining this. --- lib/gssapi/sanon/sanon_locl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gssapi/sanon/sanon_locl.h b/lib/gssapi/sanon/sanon_locl.h index 7b3c4780a..93d6aa859 100644 --- a/lib/gssapi/sanon/sanon_locl.h +++ b/lib/gssapi/sanon/sanon_locl.h @@ -50,7 +50,7 @@ typedef struct sanon_ctx_desc { uint8_t pk[crypto_scalarmult_curve25519_BYTES]; /* krb5 context for message protection/PRF */ gss_ctx_id_t rfc4121; - int is_initiator : 1; + unsigned is_initiator : 1; } *sanon_ctx; extern gss_name_t _gss_sanon_anonymous_identity;