8302337: JDK crashes if lib/modules contains non-zero byte containing ATTRIBUTE_END

Reviewed-by: stuefe, jlaskey, alanb
This commit is contained in:
Severin Gehwolf 2023-02-14 09:27:36 +00:00
parent 7f71a1040d
commit ee5f6e156d

View File

@ -130,6 +130,9 @@ void ImageLocation::set_data(u1* data) {
// Extract kind from header byte.
u1 kind = attribute_kind(byte);
assert(kind < ATTRIBUTE_COUNT && "invalid image location attribute");
if (kind == ATTRIBUTE_END) {
break;
}
// Extract length of data (in bytes).
u1 n = attribute_length(byte);
// Read value (most significant first.)