gss: fix signedness on is_initiator bitfield
authorLuke Howard <lukeh@padl.com>
Mon, 27 Apr 2020 08:44:02 +0000 (18:44 +1000)
committerLuke Howard <lukeh@padl.com>
Mon, 27 Apr 2020 08:44:02 +0000 (18:44 +1000)
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

index 7b3c4780a3f87d677fb200c786ef83ed49f17388..93d6aa859bbeb948495082bbd0d72391f55b4e69 100644 (file)
@@ -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;