RFR: 8301132: Test update for deprecated sprintf in Xcode 14

Mikael Vidstedt mikael at openjdk.org
Thu Jan 26 18:11:18 UTC 2023


On Thu, 26 Jan 2023 06:38:00 GMT, Xue-Lei Andrew Fan <xuelei at openjdk.org> wrote:

> The sprintf is deprecated in Xcode 14 because of security concerns. The issue was addressed in [JDK-8296812](https://bugs.openjdk.org/browse/JDK-8296812)/[JDK-8299378](https://bugs.openjdk.org/browse/JDK-8299378)/[JDK-8299635](https://bugs.openjdk.org/browse/JDK-8299635), but the test was not fully covered yet. This would be the last effort to fix the issue in test.

test/jdk/sun/management/windows/exerevokeall.c line 102:

> 100: 
> 101:     // S-SID_REVISION
> 102:     snprintf(name, sizeof(name), "S-%lu-", SID_REVISION );

Name is a `char *` so sizeof will return the size of the pointer, not the length of the allocate data.

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

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


More information about the serviceability-dev mailing list