On Wed, 11 Jan 2023 06:26:18 GMT, Xue-Lei Andrew Fan <xue...@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) > for hotspot impl, and > [JDK-8299378](https://bugs.openjdk.org/browse/JDK-8299378) for building, but > the test case was not covered. The failure was reported in [PR > 11793](https://github.com/openjdk/jdk/pull/11793#issuecomment-1371151565), > while running tier1 testing. > > This patch is trying to find the use of sprintf in test cases, and replace it > with snprintf accordingly. This looks good. Thank you for fixing it. Serguei There are more uses of sprintf in some serviceability folders: src/jdk.hotspot.agent/linux/native/libsaproc/ps_proc.c: sprintf(fname, "/proc/%d/status", pid); src/jdk.hotspot.agent/linux/native/libsaproc/ps_proc.c: sprintf(fname, "/proc/%d/maps", ph->pid); src/jdk.hotspot.agent/linux/native/libsaproc/symtab.c: s = filename + sprintf (filename, "%s/.build-id/", debug_file_directory); src/jdk.hotspot.agent/linux/native/libsaproc/symtab.c: s += sprintf (s, "%02x", *data++); src/jdk.hotspot.agent/linux/native/libsaproc/symtab.c: s += sprintf (s, "%02x", *data++); src/jdk.hotspot.agent/windows/native/libsaproc/sawindbg.cpp: sprintf(errmsg, "%s (hr: 0x%08X)", str, hr); \ src/jdk.management/share/native/libmanagement_ext/management_ext.c: sprintf(errmsg, "errno: %d error: %s\n", errno, msg); src/java.management/share/native/libmanagement/VMManagementImpl.c: sprintf(buf, "%d.%d", major, minor); src/java.management/share/native/libmanagement/management.c: sprintf(errmsg, "errno: %d error: %s\n", errno, msg); src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c: sprintf(msg, "handshake failed - received >%s< - expected >%s<", b, hello); src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c: sprintf(buf, "%d", portNum); src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c: sprintf(ebuf, "ERROR: Peer not allowed to connect: %s\n", src/jdk.jdwp.agent/windows/native/libdt_socket/socket_md.c: sprintf(buf, "winsock error %d", error); src/jdk.jdwp.agent/windows/native/libjdwp/linker_md.c: sprintf(holder, "%s.dll", fname); ------------- Marked as reviewed by sspitsyn (Reviewer). PR: https://git.openjdk.org/jdk/pull/11935