diff src/share/vm/prims/jvmtiRedefineClasses.cpp @ 6203:04ade88d9712

6294277: java -Xdebug crashes on SourceDebugExtension attribute larger than 64K Reviewed-by: sspitsyn, dholmes, coleenp, kamg
author fparain
date Mon, 09 Jul 2012 01:28:37 -0700
parents d2a62e0f25eb
children e74da3c2b827
line wrap: on
line diff
--- a/src/share/vm/prims/jvmtiRedefineClasses.cpp	Thu Jun 28 11:37:28 2012 +0200
+++ b/src/share/vm/prims/jvmtiRedefineClasses.cpp	Mon Jul 09 01:28:37 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -3236,7 +3236,9 @@
 
   // Copy the "source debug extension" attribute from new class version
   the_class->set_source_debug_extension(
-    scratch_class->source_debug_extension());
+    scratch_class->source_debug_extension(),
+    scratch_class->source_debug_extension() == NULL ? 0 :
+    (int)strlen(scratch_class->source_debug_extension()));
 
   // Use of javac -g could be different in the old and the new
   if (scratch_class->access_flags().has_localvariable_table() !=