From 59b943252486fae732e516bae095728a14891f9c Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Mon, 27 Nov 2023 12:55:51 +1300 Subject: [PATCH] conditional_ace.idl: Fix undefined shift MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If ‘int’ is a 32‐bit type, then 1 << 31 cannot be represented in an ‘int’, and this shift will invoke undefined behaviour. We have got away with this so far because of a Pidl bug that changed the expression to ‘(uint32_t)1 << 31’, which is valid. But that bug is about to be fixed. Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- librpc/idl/conditional_ace.idl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/librpc/idl/conditional_ace.idl b/librpc/idl/conditional_ace.idl index 60b8966055a..8db0ed66b7b 100644 --- a/librpc/idl/conditional_ace.idl +++ b/librpc/idl/conditional_ace.idl @@ -428,7 +428,7 @@ interface conditional_ace * operator that argument has been resolved into an ordinary * token. So we set the flag so the operator can know. */ - const uint32 CONDITIONAL_ACE_FLAG_TOKEN_FROM_ATTR = 1 << 31; + const uint32 CONDITIONAL_ACE_FLAG_TOKEN_FROM_ATTR = UINT32_C(1) << 31; /* * The maximum size of the conditional ACE conditions in the