8228407: JVM crashes with shared archive file mismatch

Stop processing other header fields if initial header check has failed.

Reviewed-by: dholmes, jiangli
This commit is contained in:
Calvin Cheung 2019-07-25 10:25:52 -07:00
parent 3476b6dab8
commit fc7aa2306c
2 changed files with 13 additions and 3 deletions

View file

@ -1610,7 +1610,9 @@ bool FileMapInfo::initialize(bool is_static) {
}
init_from_file(_fd, is_static);
if (!validate_header(is_static)) {
// UseSharedSpaces could be disabled if the checking of some of the header fields in
// init_from_file has failed.
if (!UseSharedSpaces || !validate_header(is_static)) {
return false;
}
return true;