diff options
author | aph <unknown> | 2019-02-01 10:47:30 +0100 |
---|---|---|
committer | bell-sw <liberica@bell-sw.com> | 2019-07-22 19:21:51 +0300 |
commit | 9bf6fef2327d0b2b98dc50944e3d167210d0715a (patch) | |
tree | dd2a1c4e1caf8345d91a3a31147d94242ca66f7e /src/os | |
parent | b80765b0672368f8e944065170c550612852d737 (diff) | |
download | jdk8u_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.cpp | 6 |
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" }, |