undefect. CWE-407 — 63 sites patched across 27 ecosystems
Authors: russell@unturf.com · brackishbert@gmail.com · foxhop.net · TimeHexOn.com Patches, unit tests, benchmarks, whitepaper, and outreach briefs. Public domain — no copyright claimed. Use freely.
This commit is contained in:
commit
0a580b313d
70422 changed files with 17213626 additions and 0 deletions
291
test/hotspot/jtreg/runtime/ClassFile/classFileVersions.jcod
Normal file
291
test/hotspot/jtreg/runtime/ClassFile/classFileVersions.jcod
Normal file
|
|
@ -0,0 +1,291 @@
|
|||
/*
|
||||
* Copyright (c) 2022, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
// Class with major version 64 and minor version 0
|
||||
class Version64 {
|
||||
0xCAFEBABE;
|
||||
0; // minor version
|
||||
64; // version
|
||||
[14] { // Constant Pool
|
||||
; // first element is empty
|
||||
Method #2 #3; // #1 at 0x0A
|
||||
class #4; // #2 at 0x0F
|
||||
NameAndType #5 #6; // #3 at 0x12
|
||||
Utf8 "java/lang/Object"; // #4 at 0x17
|
||||
Utf8 "<init>"; // #5 at 0x2A
|
||||
Utf8 "()V"; // #6 at 0x33
|
||||
class #8; // #7 at 0x39
|
||||
Utf8 "Version64"; // #8 at 0x3C
|
||||
Utf8 "Code"; // #9 at 0x48
|
||||
Utf8 "LineNumberTable"; // #10 at 0x4F
|
||||
Utf8 "hi"; // #11 at 0x61
|
||||
Utf8 "SourceFile"; // #12 at 0x66
|
||||
Utf8 "Version64.java"; // #13 at 0x73
|
||||
} // Constant Pool
|
||||
|
||||
0x0021; // access [ ACC_PUBLIC ACC_SUPER ]
|
||||
#7;// this_cpx
|
||||
#2;// super_cpx
|
||||
|
||||
[0] { // Interfaces
|
||||
} // Interfaces
|
||||
|
||||
[0] { // Fields
|
||||
} // Fields
|
||||
|
||||
[2] { // Methods
|
||||
{ // method at 0x90
|
||||
0x0001; // access
|
||||
#5; // name_index : <init>
|
||||
#6; // descriptor_index : ()V
|
||||
[1] { // Attributes
|
||||
Attr(#9, 29) { // Code at 0x98
|
||||
1; // max_stack
|
||||
1; // max_locals
|
||||
Bytes[5]{
|
||||
0x2AB70001B1;
|
||||
}
|
||||
[0] { // Traps
|
||||
} // end Traps
|
||||
[1] { // Attributes
|
||||
Attr(#10, 6) { // LineNumberTable at 0xAF
|
||||
[1] { // line_number_table
|
||||
0 1; // at 0xBB
|
||||
}
|
||||
} // end LineNumberTable
|
||||
} // Attributes
|
||||
} // end Code
|
||||
} // Attributes
|
||||
}
|
||||
;
|
||||
{ // method at 0xBB
|
||||
0x0009; // access
|
||||
#11; // name_index : hi
|
||||
#6; // descriptor_index : ()V
|
||||
[1] { // Attributes
|
||||
Attr(#9, 25) { // Code at 0xC3
|
||||
0; // max_stack
|
||||
0; // max_locals
|
||||
Bytes[1]{
|
||||
0xB1;
|
||||
}
|
||||
[0] { // Traps
|
||||
} // end Traps
|
||||
[1] { // Attributes
|
||||
Attr(#10, 6) { // LineNumberTable at 0xD6
|
||||
[1] { // line_number_table
|
||||
0 2; // at 0xE2
|
||||
}
|
||||
} // end LineNumberTable
|
||||
} // Attributes
|
||||
} // end Code
|
||||
} // Attributes
|
||||
}
|
||||
} // Methods
|
||||
|
||||
[1] { // Attributes
|
||||
Attr(#12, 2) { // SourceFile at 0xE4
|
||||
#13;
|
||||
} // end SourceFile
|
||||
} // Attributes
|
||||
} // end class Version64
|
||||
|
||||
|
||||
// Class with major version 59 and minor version 0
|
||||
class Version59 {
|
||||
0xCAFEBABE;
|
||||
0; // minor version
|
||||
59; // version
|
||||
[14] { // Constant Pool
|
||||
; // first element is empty
|
||||
Method #2 #3; // #1 at 0x0A
|
||||
class #4; // #2 at 0x0F
|
||||
NameAndType #5 #6; // #3 at 0x12
|
||||
Utf8 "java/lang/Object"; // #4 at 0x17
|
||||
Utf8 "<init>"; // #5 at 0x2A
|
||||
Utf8 "()V"; // #6 at 0x33
|
||||
class #8; // #7 at 0x39
|
||||
Utf8 "Version59"; // #8 at 0x3C
|
||||
Utf8 "Code"; // #9 at 0x48
|
||||
Utf8 "LineNumberTable"; // #10 at 0x4F
|
||||
Utf8 "hi"; // #11 at 0x61
|
||||
Utf8 "SourceFile"; // #12 at 0x66
|
||||
Utf8 "Version59.java"; // #13 at 0x73
|
||||
} // Constant Pool
|
||||
|
||||
0x0021; // access [ ACC_PUBLIC ACC_SUPER ]
|
||||
#7;// this_cpx
|
||||
#2;// super_cpx
|
||||
|
||||
[0] { // Interfaces
|
||||
} // Interfaces
|
||||
|
||||
[0] { // Fields
|
||||
} // Fields
|
||||
|
||||
[2] { // Methods
|
||||
{ // method at 0x90
|
||||
0x0001; // access
|
||||
#5; // name_index : <init>
|
||||
#6; // descriptor_index : ()V
|
||||
[1] { // Attributes
|
||||
Attr(#9, 29) { // Code at 0x98
|
||||
1; // max_stack
|
||||
1; // max_locals
|
||||
Bytes[5]{
|
||||
0x2AB70001B1;
|
||||
}
|
||||
[0] { // Traps
|
||||
} // end Traps
|
||||
[1] { // Attributes
|
||||
Attr(#10, 6) { // LineNumberTable at 0xAF
|
||||
[1] { // line_number_table
|
||||
0 1; // at 0xBB
|
||||
}
|
||||
} // end LineNumberTable
|
||||
} // Attributes
|
||||
} // end Code
|
||||
} // Attributes
|
||||
}
|
||||
;
|
||||
{ // method at 0xBB
|
||||
0x0009; // access
|
||||
#11; // name_index : hi
|
||||
#6; // descriptor_index : ()V
|
||||
[1] { // Attributes
|
||||
Attr(#9, 25) { // Code at 0xC3
|
||||
0; // max_stack
|
||||
0; // max_locals
|
||||
Bytes[1]{
|
||||
0xB1;
|
||||
}
|
||||
[0] { // Traps
|
||||
} // end Traps
|
||||
[1] { // Attributes
|
||||
Attr(#10, 6) { // LineNumberTable at 0xD6
|
||||
[1] { // line_number_table
|
||||
0 2; // at 0xE2
|
||||
}
|
||||
} // end LineNumberTable
|
||||
} // Attributes
|
||||
} // end Code
|
||||
} // Attributes
|
||||
}
|
||||
} // Methods
|
||||
|
||||
[1] { // Attributes
|
||||
Attr(#12, 2) { // SourceFile at 0xE4
|
||||
#13;
|
||||
} // end SourceFile
|
||||
} // Attributes
|
||||
} // end class Version59
|
||||
|
||||
// Class with major version 45 and minor version 3
|
||||
class Version45_3 {
|
||||
0xCAFEBABE;
|
||||
3; // minor version
|
||||
45; // version
|
||||
[14] { // Constant Pool
|
||||
; // first element is empty
|
||||
Method #2 #3; // #1 at 0x0A
|
||||
class #4; // #2 at 0x0F
|
||||
NameAndType #5 #6; // #3 at 0x12
|
||||
Utf8 "java/lang/Object"; // #4 at 0x17
|
||||
Utf8 "<init>"; // #5 at 0x2A
|
||||
Utf8 "()V"; // #6 at 0x33
|
||||
class #8; // #7 at 0x39
|
||||
Utf8 "Version45_3"; // #8 at 0x3C
|
||||
Utf8 "Code"; // #9 at 0x48
|
||||
Utf8 "LineNumberTable"; // #10 at 0x4F
|
||||
Utf8 "hi"; // #11 at 0x61
|
||||
Utf8 "SourceFile"; // #12 at 0x66
|
||||
Utf8 "Version45_3.java"; // #13 at 0x73
|
||||
} // Constant Pool
|
||||
|
||||
0x0021; // access [ ACC_PUBLIC ACC_SUPER ]
|
||||
#7;// this_cpx
|
||||
#2;// super_cpx
|
||||
|
||||
[0] { // Interfaces
|
||||
} // Interfaces
|
||||
|
||||
[0] { // Fields
|
||||
} // Fields
|
||||
|
||||
[2] { // Methods
|
||||
{ // method at 0x90
|
||||
0x0001; // access
|
||||
#5; // name_index : <init>
|
||||
#6; // descriptor_index : ()V
|
||||
[1] { // Attributes
|
||||
Attr(#9, 29) { // Code at 0x98
|
||||
1; // max_stack
|
||||
1; // max_locals
|
||||
Bytes[5]{
|
||||
0x2AB70001B1;
|
||||
}
|
||||
[0] { // Traps
|
||||
} // end Traps
|
||||
[1] { // Attributes
|
||||
Attr(#10, 6) { // LineNumberTable at 0xAF
|
||||
[1] { // line_number_table
|
||||
0 1; // at 0xBB
|
||||
}
|
||||
} // end LineNumberTable
|
||||
} // Attributes
|
||||
} // end Code
|
||||
} // Attributes
|
||||
}
|
||||
;
|
||||
{ // method at 0xBB
|
||||
0x0009; // access
|
||||
#11; // name_index : hi
|
||||
#6; // descriptor_index : ()V
|
||||
[1] { // Attributes
|
||||
Attr(#9, 25) { // Code at 0xC3
|
||||
0; // max_stack
|
||||
0; // max_locals
|
||||
Bytes[1]{
|
||||
0xB1;
|
||||
}
|
||||
[0] { // Traps
|
||||
} // end Traps
|
||||
[1] { // Attributes
|
||||
Attr(#10, 6) { // LineNumberTable at 0xD6
|
||||
[1] { // line_number_table
|
||||
0 2; // at 0xE2
|
||||
}
|
||||
} // end LineNumberTable
|
||||
} // Attributes
|
||||
} // end Code
|
||||
} // Attributes
|
||||
}
|
||||
} // Methods
|
||||
|
||||
[1] { // Attributes
|
||||
Attr(#12, 2) { // SourceFile at 0xE4
|
||||
#13;
|
||||
} // end SourceFile
|
||||
} // Attributes
|
||||
} // end class Version45_3
|
||||
Loading…
Add table
Add a link
Reference in a new issue