changeset 59259:ee4bd700b772

8244767: Potential non-terminated string in getEncodingInternal() on Windows Reviewed-by: bpb, naoto Contributed-by: Johannes Kuhn <info@j-kuhn.de>
author bchristi
date Tue, 12 May 2020 11:20:34 -0700
parents bd06e64b05db
children 843f2c9f456e
files src/java.base/windows/native/libjava/java_props_md.c
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/windows/native/libjava/java_props_md.c	Tue May 12 19:48:50 2020 +0200
+++ b/src/java.base/windows/native/libjava/java_props_md.c	Tue May 12 11:20:34 2020 -0700
@@ -73,6 +73,7 @@
                       LOCALE_IDEFAULTANSICODEPAGE,
                       ret+2, 14) == 0) {
         codepage = 1252;
+        strcpy(ret+2, "1252");
     } else {
         codepage = atoi(ret+2);
     }