RFR: 8264684: os::get_summary_cpu_info padded with spaces

Afshin Zafari duke at openjdk.org
Tue Jan 10 09:53:35 UTC 2023


### Description 
In Windows, the strings read from Registry entries may be shorter than the buffer given to the API to fill in. In these cases, the actual size is written to the `size` parameter of the API. 

### Patch
The given buffer is null terminated at the position of the returned `size`, if it is not longer than the buffer length.

### Tests
local: linux-x64 some tests that crashed and wrote the Host info using the changed code.
mach5: tier1-5

-------------

Commit messages:
 - 8264684: os::get_summary_cpu_info padded with spaces

Changes: https://git.openjdk.org/jdk/pull/11920/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=11920&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8264684
  Stats: 5 lines in 1 file changed: 4 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/11920.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11920/head:pull/11920

PR: https://git.openjdk.org/jdk/pull/11920


More information about the hotspot-runtime-dev mailing list