JDK-8299593 : getprotobyname should not be used
  • Type: Bug
  • Component: core-svc
  • Sub-Component: debugger
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-01-04
  • Updated: 2023-01-09
  • Resolved: 2023-01-09
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 21
21 masterFixed
Related Reports
Relates :  
Description
The function getprotobyname is not thread-safe; it returns a pointer to a statically allocated structure. It should not be used.

The function is used to retrieve protocol number for TCP. There's a compile-time constant IPPROTO_TCP that can be used instead. While the protocol number for TCP could theoretically be changed, this is something we have never observed in practice, and it probably doesn't make sense to test.
Comments
Changeset: d03a5d95 Author: Daniel JeliƄski <djelinski@openjdk.org> Date: 2023-01-09 07:32:55 +0000 URL: https://git.openjdk.org/jdk/commit/d03a5d9580ef3b9be4d766ff9a11d6fd5fa133f9
09-01-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/11842 Date: 2023-01-04 12:56:18 +0000
04-01-2023