changeset 25538:421c18d84c71

8037046: Validate libraries to be loaded Reviewed-by: ksrini, ahgross
author kizune
date Sat, 22 Mar 2014 02:21:11 +0400
parents 087de200d457
children 9d290547d266
files jdk/src/windows/bin/java_md.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/windows/bin/java_md.c	Mon Jul 14 13:57:44 2014 +0400
+++ b/jdk/src/windows/bin/java_md.c	Sat Mar 22 02:21:11 2014 +0400
@@ -1306,6 +1306,14 @@
             /* save path length */
             jrePathLen = JLI_StrLen(libraryPath);
 
+            if (jrePathLen + JLI_StrLen("\\bin\\verify.dll") >= MAXPATHLEN) {
+              /* jre path is too long, the library path will not fit there;
+               * report and abort preloading
+               */
+              JLI_ReportErrorMessage(JRE_ERROR11);
+              break;
+            }
+
             /* load msvcrt 1st */
             LoadMSVCRT();