mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8341243: Use ArraySupport.SOFT_MAX_ARRAY_LENGTH for max array size in java.base
Reviewed-by: jpai, smarks
This commit is contained in:
parent
8d6d37fea1
commit
0f381137cb
15 changed files with 51 additions and 41 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2024, 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
|
||||
|
@ -36,6 +36,7 @@ import java.util.*;
|
|||
import java.util.jar.Attributes;
|
||||
import java.util.jar.Manifest;
|
||||
|
||||
import jdk.internal.util.ArraysSupport;
|
||||
import sun.security.action.GetIntegerAction;
|
||||
import sun.security.jca.Providers;
|
||||
import sun.security.pkcs.PKCS7;
|
||||
|
@ -87,8 +88,8 @@ public class SignatureFileVerifier {
|
|||
// the maximum allowed size in bytes for the signature-related files
|
||||
public static final int MAX_SIG_FILE_SIZE = initializeMaxSigFileSize();
|
||||
|
||||
// The maximum size of array to allocate. Some VMs reserve some header words in an array.
|
||||
private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8;
|
||||
// The maximum size of array to allocate
|
||||
private static final int MAX_ARRAY_SIZE = ArraysSupport.SOFT_MAX_ARRAY_LENGTH;
|
||||
|
||||
/**
|
||||
* Create the named SignatureFileVerifier.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue