jdk/src/share/bin/java.c
changeset 2624 1ae5a9028dd4
parent 1323 e14a3b3536cd
parent 2598 6f980e1d6e31
child 3054 ddb6acba8b6f
--- a/jdk/src/share/bin/java.c	Sun Apr 12 20:21:43 2009 -0700
+++ b/jdk/src/share/bin/java.c	Thu Apr 16 21:08:04 2009 -0700
@@ -915,8 +915,14 @@
      * to avoid locating, expanding and parsing the manifest extra
      * times.
      */
-    if (info.main_class != NULL)
-        (void)JLI_StrCat(env_entry, info.main_class);
+    if (info.main_class != NULL) {
+        if (JLI_StrLen(info.main_class) <= MAXNAMELEN) {
+            (void)JLI_StrCat(env_entry, info.main_class);
+        } else {
+            JLI_ReportErrorMessage(CLS_ERROR5, MAXNAMELEN);
+            exit(1);
+        }
+    }
     (void)putenv(env_entry);
     ExecJRE(jre, new_argv);
     JLI_FreeManifest();