ldap: Promote uint8 to uint64 before shifting

Relates to zeek/spicy#1829
This commit is contained in:
Arne Welzel 2024-08-07 13:04:16 +02:00
parent 2c62ecf57d
commit 2be39cf0d0

View file

@ -196,7 +196,7 @@ type MaybeEncrypted = unit(ctx: Ctx&) {
# If so, switch into KRB mode assuming that's what is being used and # If so, switch into KRB mode assuming that's what is being used and
# have a chance seeing some more plaintext LDAP in non-sealed tokens. # have a chance seeing some more plaintext LDAP in non-sealed tokens.
rem: uint8[3] if ( ctx.messageMode == MessageMode::ENCRYPTED && (|self.mech| == 0 || self.mech.starts_with(b"GSS")) ) { rem: uint8[3] if ( ctx.messageMode == MessageMode::ENCRYPTED && (|self.mech| == 0 || self.mech.starts_with(b"GSS")) ) {
self.saslLen = (self.first << 24) + ($$[0] << 16) + ($$[1] << 8) + $$[2]; self.saslLen = (uint64(self.first) << 24) + (uint64($$[0]) << 16) + (uint64($$[1]) << 8) + uint64($$[2]);
} }
: uint16 if ( self.saslLen >= 2 ) { : uint16 if ( self.saslLen >= 2 ) {