]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
nss: Group merge does not react to ERANGE during merge (bug 33361)
authorFlorian Weimer <fweimer@redhat.com>
Fri, 12 Sep 2025 19:33:34 +0000 (21:33 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 19 Sep 2025 07:36:13 +0000 (09:36 +0200)
The break statement in CHECK_MERGE is expected to exit the surrounding
while loop, not the do-while loop with in the macro.  Remove the
do-while loop from the macro.  It is not needed to turn the macro
expansion into a single statement due to the way CHECK_MERGE is used
(and the statement expression would cover this anyway).

Reviewed-by: Collin Funk <collin.funk1@gmail.com>
(cherry picked from commit 0fceed254559836b57ee05188deac649bc505d05)

NEWS
nss/getXXbyYY_r.c

diff --git a/NEWS b/NEWS
index acb5179088477e5709e9a969539b8f9e18a70166..0756d27503bc685eb8bf1b18e95dfc85d7104534 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -29,6 +29,7 @@ The following bugs are resolved with this release:
   [32987] elf: Fix subprocess status handling for tst-dlopen-sgid
   [33185] Fix double-free after allocation failure in regcomp
   [33234] Use TLS initial-exec model for __libc_tsd_CTYPE_* thread variables
+  [33361] nss: Group merge does not react to ERANGE during merge
 \f
 Version 2.40
 
index fe7d5b7d0eddfb05d77346464a1d394537036aae..3a15b1a4ae151fccf26b614b0dcd0e1b7413cac2 100644 (file)
@@ -157,19 +157,15 @@ __merge_einval (LOOKUP_TYPE *a,
 
 #define CHECK_MERGE(err, status)               \
   ({                                           \
-    do                                         \
+    if (err)                                   \
       {                                                \
-       if (err)                                \
-         {                                     \
-           __set_errno (err);                  \
-           if (err == ERANGE)                  \
-             status = NSS_STATUS_TRYAGAIN;     \
-           else                                \
-             status = NSS_STATUS_UNAVAIL;      \
-           break;                              \
-         }                                     \
+       __set_errno (err);                      \
+       if (err == ERANGE)                      \
+         status = NSS_STATUS_TRYAGAIN;         \
+       else                                    \
+         status = NSS_STATUS_UNAVAIL;          \
+       break;                                  \
       }                                                \
-    while (0);                                 \
   })
 
 /* Type of the lookup function we need here.  */