changeset 7403:81abcd983361

8037046: Validate libraries to be loaded Reviewed-by: ksrini, ahgross
author kizune
date Tue, 25 Mar 2014 11:28:26 -0700
parents 1c76e1c3182f
children 7d8e5d907895
files src/windows/bin/java_md.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/bin/java_md.c	Thu Mar 27 12:22:55 2014 -0700
+++ b/src/windows/bin/java_md.c	Tue Mar 25 11:28:26 2014 -0700
@@ -1301,6 +1301,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();