Module Name:    src
Committed By:   njoly
Date:           Sat Feb 28 13:08:00 UTC 2015

Modified Files:
        src/sys/compat/linux/common: linux_limit.h

Log Message:
When converting limits from linux32 (int32_t) to native (uint64_t),
cast it to unsigned first to avoid bad side effect for negative
values.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/compat/linux/common/linux_limit.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/common/linux_limit.h
diff -u src/sys/compat/linux/common/linux_limit.h:1.6 src/sys/compat/linux/common/linux_limit.h:1.7
--- src/sys/compat/linux/common/linux_limit.h:1.6	Sat Sep 22 22:34:02 2012
+++ src/sys/compat/linux/common/linux_limit.h	Sat Feb 28 13:08:00 2015
@@ -1,4 +1,4 @@
-/* 	$NetBSD: linux_limit.h,v 1.6 2012/09/22 22:34:02 joerg Exp $ */
+/* 	$NetBSD: linux_limit.h,v 1.7 2015/02/28 13:08:00 njoly Exp $ */
 
 /*-
  * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@ static int linux_to_bsd_limit(int);
     linux_to_bsd_rlimit1(b, l, rlim_max)
 
 #define linux32_to_bsd_rlimit1(b, l, f) \
-    (b)->f = (l)->f == LINUX32_RLIM_INFINITY ? RLIM_INFINITY : (l)->f
+    (b)->f = (l)->f == LINUX32_RLIM_INFINITY ? RLIM_INFINITY : (uint32_t)(l)->f
 #define linux32_to_bsd_rlimit(b, l) \
     linux32_to_bsd_rlimit1(b, l, rlim_cur); \
     linux32_to_bsd_rlimit1(b, l, rlim_max)

Reply via email to