--- 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();