From 3a5068f2946be08f600fe7dfc1921298096fbb35 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 4 Nov 2024 18:26:43 +0100 Subject: [PATCH] libcli: Try to fix CID 1609583 Overflowed constant Coverity does not like the --i Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- libcli/security/security_descriptor.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libcli/security/security_descriptor.c b/libcli/security/security_descriptor.c index 9b9f16c6d2e..c550d6ed751 100644 --- a/libcli/security/security_descriptor.c +++ b/libcli/security/security_descriptor.c @@ -399,7 +399,10 @@ static NTSTATUS security_descriptor_acl_del(struct security_descriptor *sd, } /* there can be multiple ace's for one trustee */ - for (i=0;inum_aces;i++) { + + i = 0; + + while (inum_aces) { if (dom_sid_equal(trustee, &acl->aces[i].trustee)) { ARRAY_DEL_ELEMENT(acl->aces, i, acl->num_aces); acl->num_aces--; @@ -407,7 +410,8 @@ static NTSTATUS security_descriptor_acl_del(struct security_descriptor *sd, acl->aces = NULL; } found = true; - --i; + } else { + i += 1; } } -- 2.11.4.GIT