about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/i386/setregid.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/i386/setregid.c')
-rw-r--r--sysdeps/unix/sysv/linux/i386/setregid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/setregid.c b/sysdeps/unix/sysv/linux/i386/setregid.c
index 4f00d30bc6..b4d0a2a116 100644
--- a/sysdeps/unix/sysv/linux/i386/setregid.c
+++ b/sysdeps/unix/sysv/linux/i386/setregid.c
@@ -59,8 +59,8 @@ __setregid (gid_t rgid, gid_t egid)
       __libc_missing_32bit_uids = 1;
     }
 # endif /* __NR_setregid32 */
-  if ((rgid != (gid_t) -1 && rgid != (gid_t) (__kernel_gid_t) rgid)
-      || (egid != (gid_t) -1 && egid != (gid_t) (__kernel_gid_t) egid))
+  if (((rgid + 1) > (gid_t) ((__kernel_gid_t) -1U))
+      || ((egid + 1) > (gid_t) ((__kernel_gid_t) -1U)))
     {
       __set_errno (EINVAL);
       return -1;