https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=a6bc726adff7e1abeae81b94e4a5d3a46cf5e6b2

commit a6bc726adff7e1abeae81b94e4a5d3a46cf5e6b2
Author:     Corinna Vinschen <[email protected]>
AuthorDate: Wed Jan 15 15:50:29 2025 +0100
Commit:     Corinna Vinschen <[email protected]>
CommitDate: Wed Jan 15 15:50:29 2025 +0100

    Cygwin: get_posix_access: initalize obj_idx
    
    This fixes a false positive gcc warning.
    
    Fixes: 01c9386fd805 ("Cygwin: get_posix_access: improve merging 
permissions")
    Signed-off-by: Corinna Vinschen <[email protected]>

Diff:
---
 winsup/cygwin/sec/acl.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/cygwin/sec/acl.cc b/winsup/cygwin/sec/acl.cc
index 9e041acc1203..3efcfadfdd1f 100644
--- a/winsup/cygwin/sec/acl.cc
+++ b/winsup/cygwin/sec/acl.cc
@@ -1075,7 +1075,7 @@ get_posix_access (PSECURITY_DESCRIPTOR psd,
         and default perms from the same Windows ACE. */
       for (idx = 0; idx < pos; ++idx)
        {
-         int obj_idx;
+         int obj_idx = -1;
 
          if (!(lacl[idx].a_perm & FULL_ACE))
            continue;

Reply via email to