Upgradeable loader max_data_len limit (#15039) (#15057)

(cherry picked from commit d24d5fba0e)

Co-authored-by: Jack May <jack@solana.com>
This commit is contained in:
mergify[bot]
2021-02-03 18:34:06 +00:00
committed by GitHub
parent ba0aa706e4
commit f463ebfde2
2 changed files with 44 additions and 9 deletions

View File

@@ -53,7 +53,7 @@ impl UpgradeableLoaderState {
})
.map(|len| len as usize)
.map_err(|_| InstructionError::InvalidInstructionData)?
+ program_len)
.saturating_add(program_len))
}
/// Offset into the ProgramData account's data of the program bits.
pub fn buffer_data_offset() -> Result<usize, InstructionError> {
@@ -75,7 +75,7 @@ impl UpgradeableLoaderState {
})
.map(|len| len as usize)
.map_err(|_| InstructionError::InvalidInstructionData)?
+ program_len)
.saturating_add(program_len))
}
/// Offset into the ProgramData account's data of the program bits.
pub fn programdata_data_offset() -> Result<usize, InstructionError> {