Check data size at built-in.

This commit is contained in:
Stephen Chung
2022-10-20 11:38:54 +08:00
parent 9f36afc84c
commit 988222418e
6 changed files with 202 additions and 68 deletions

View File

@@ -79,11 +79,9 @@ pub mod blob_functions {
let _ctx = ctx;
// Check if blob will be over max size limit
if _ctx.engine().max_array_size() > 0 && len > _ctx.engine().max_array_size() {
return Err(
crate::ERR::ErrorDataTooLarge("Size of BLOB".to_string(), Position::NONE).into(),
);
}
#[cfg(not(feature = "unchecked"))]
_ctx.engine()
.raise_err_if_over_data_size_limit((len, 0, 0))?;
let mut blob = Blob::new();
blob.resize(len, (value & 0x0000_00ff) as u8);