aboutsummaryrefslogtreecommitdiff
path: root/src/os
diff options
context:
space:
mode:
authoraph <unknown>2019-02-01 10:47:30 +0100
committerbell-sw <liberica@bell-sw.com>2019-07-22 19:21:51 +0300
commit9bf6fef2327d0b2b98dc50944e3d167210d0715a (patch)
treedd2a1c4e1caf8345d91a3a31147d94242ca66f7e /src/os
parentb80765b0672368f8e944065170c550612852d737 (diff)
downloadjdk8u_hotspot-9bf6fef2327d0b2b98dc50944e3d167210d0715a.tar.gz
8145096: Undefined behaviour in HotSpot
Summary: Fix some integer overflows Reviewed-by: jrose, kvn, kbarrett, adinn, iklam
Diffstat (limited to 'src/os')
-rw-r--r--src/os/posix/vm/os_posix.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/os/posix/vm/os_posix.cpp b/src/os/posix/vm/os_posix.cpp
index c301898a2..534b19258 100644
--- a/src/os/posix/vm/os_posix.cpp
+++ b/src/os/posix/vm/os_posix.cpp
@@ -604,7 +604,11 @@ const char* os::Posix::describe_sa_flags(int flags, char* buffer, size_t size) {
strncpy(buffer, "none", size);
const struct {
- int i;
+ // NB: i is an unsigned int here because SA_RESETHAND is on some
+ // systems 0x80000000, which is implicitly unsigned. Assignining
+ // it to an int field would be an overflow in unsigned-to-signed
+ // conversion.
+ unsigned int i;
const char* s;
} flaginfo [] = {
{ SA_NOCLDSTOP, "SA_NOCLDSTOP" },