JDK-8165463 : Native implementation of sunmscapi should use operator new (nothrow) for allocations
  • Type: Bug
  • Component: security-libs
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • Submitted: 2016-09-05
  • Updated: 2019-02-18
  • Resolved: 2016-10-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 JDK 8 JDK 9 Other
6u211Fixed 7u201Fixed 8u192Fixed 9 b142Fixed openjdk7uFixed
Currently, the form of ::operator new() is used, which throws std::bad_alloc upon failure.
Since we don't have handling of c++ exceptions in the code, such failures wouldn't be handled.

Instead, ::operator new(std::nothrow) can be used, which would return 0 in a case of a failure.
Then we can (try to) throw Java exception of type OutOfMemoryError.