# HG changeset patch # User serb # Date 1402517940 -14400 # Node ID 2972c76c5a1587c79a705752ddbaf8b521ef4818 # Parent 187a455af8f86cebac6995ebd6e7caf363f5fa5e 8040271: Uninitialised memory in jdk/src/windows/native/sun/windows: awt_List.cpp, awt_InputMethod.cpp Reviewed-by: pchelko, prr diff -r 187a455af8f8 -r 2972c76c5a15 jdk/src/windows/native/sun/windows/awt_InputMethod.cpp --- a/jdk/src/windows/native/sun/windows/awt_InputMethod.cpp Wed Jun 11 13:25:15 2014 -0700 +++ b/jdk/src/windows/native/sun/windows/awt_InputMethod.cpp Thu Jun 12 00:19:00 2014 +0400 @@ -454,7 +454,7 @@ TRY; // get list of available HKLs - int layoutCount = ::GetKeyboardLayoutList(0, NULL); + const int layoutCount = ::GetKeyboardLayoutList(0, NULL); HKL FAR * hKLList = (HKL FAR *)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, sizeof(HKL), layoutCount); CHECK_NULL_RETURN(hKLList, NULL); ::GetKeyboardLayoutList(layoutCount, hKLList); diff -r 187a455af8f8 -r 2972c76c5a15 jdk/src/windows/native/sun/windows/awt_List.cpp --- a/jdk/src/windows/native/sun/windows/awt_List.cpp Wed Jun 11 13:25:15 2014 -0700 +++ b/jdk/src/windows/native/sun/windows/awt_List.cpp Thu Jun 12 00:19:00 2014 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -219,7 +219,7 @@ JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); /* Copy current box's contents to string array */ - int nCount = GetCount(); + const int nCount = GetCount(); LPTSTR * strings = new LPTSTR[nCount]; int i;