mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8225789: Empty method parameter type should generate ClassFormatError
Check for an empty name when verifying unqualified names Reviewed-by: lfoltan, coleenp
This commit is contained in:
parent
9b2f151f30
commit
b304a57980
4 changed files with 92 additions and 2 deletions
|
@ -4956,6 +4956,7 @@ void ClassFileParser::verify_legal_utf8(const unsigned char* buffer,
|
|||
bool ClassFileParser::verify_unqualified_name(const char* name,
|
||||
unsigned int length,
|
||||
int type) {
|
||||
if (length == 0) return false; // Must have at least one char.
|
||||
for (const char* p = name; p != name + length; p++) {
|
||||
switch(*p) {
|
||||
case '.':
|
||||
|
@ -5105,7 +5106,7 @@ const char* ClassFileParser::skip_over_field_signature(const char* signature,
|
|||
int newlen = c - (char*) signature;
|
||||
bool legal = verify_unqualified_name(signature, newlen, LegalClass);
|
||||
if (!legal) {
|
||||
classfile_parse_error("Class name contains illegal character "
|
||||
classfile_parse_error("Class name is empty or contains illegal character "
|
||||
"in descriptor in class file %s",
|
||||
CHECK_0);
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue