]> 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, 12 Sep 2025 19:33:34 +0000 (21:33 +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>
nss/getXXbyYY_r.c

index eae6c3480ef645ea1eda902587cbba8805f32fa5..2b0735fb6a83e2ec6692829133ad1e2cbaf6982a 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.  */