diff --git a/cli/src/cluster_query.rs b/cli/src/cluster_query.rs index 43c16aaf9c114c..800362041936ca 100644 --- a/cli/src/cluster_query.rs +++ b/cli/src/cluster_query.rs @@ -2181,6 +2181,9 @@ pub fn process_calculate_rent( data_length: usize, use_lamports_unit: bool, ) -> ProcessResult { + if data_length > 10_000_000 { + return Err(CliError::BadParameter("Accout's maximum size is 10 MB".to_string()).into()); + } let rent_account = rpc_client.get_account(&sysvar::rent::id())?; let rent: Rent = rent_account.deserialize_data()?; let rent_exempt_minimum_lamports = rent.minimum_balance(data_length);