1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

conditional_ace.idl: Fix undefined shift

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 <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Joseph Sutton 2023-11-27 12:55:51 +13:00 committed by Andrew Bartlett
parent 3da132a8df
commit 59b9432524

View File

@ -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