Upgradeable loader max_data_len limit (#15039)

This commit is contained in:
Jack May
2021-02-03 09:16:25 -08:00
committed by GitHub
parent f2d415cf13
commit d24d5fba0e
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> {