Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/linux/common Fix signed vs. unsigned comparison i...



details:   https://anonhg.NetBSD.org/src/rev/8bba9bdc8568
branches:  trunk
changeset: 329350:8bba9bdc8568
user:      njoly <njoly%NetBSD.org@localhost>
date:      Tue May 20 17:31:18 2014 +0000

description:
Fix signed vs. unsigned comparison in getgroups16() syscall. Negative
gisetsize values now fail with EINVAL as expected.

diffstat:

 sys/compat/linux/common/linux_uid16.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 03b32f32dac5 -r 8bba9bdc8568 sys/compat/linux/common/linux_uid16.c
--- a/sys/compat/linux/common/linux_uid16.c     Tue May 20 17:26:04 2014 +0000
+++ b/sys/compat/linux/common/linux_uid16.c     Tue May 20 17:31:18 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_uid16.c,v 1.3 2008/05/20 15:48:24 njoly Exp $    */
+/*     $NetBSD: linux_uid16.c,v 1.4 2014/05/20 17:31:18 njoly Exp $    */
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_uid16.c,v 1.3 2008/05/20 15:48:24 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_uid16.c,v 1.4 2014/05/20 17:31:18 njoly Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -241,7 +241,7 @@
        *retval = ngrps;
        if (SCARG(uap, gidsetsize) == 0)
                return 0;
-       if (SCARG(uap, gidsetsize) < ngrps)
+       if (SCARG(uap, gidsetsize) < (int)ngrps)
                return EINVAL;
 
        gidset = SCARG(uap, gidset);



Home | Main Index | Thread Index | Old Index