chaokunyang commented on code in PR #3483:
URL: https://github.com/apache/fory/pull/3483#discussion_r2973512341
##########
rust/fory-core/src/row/reader.rs:
##########
@@ -103,10 +121,17 @@ pub struct MapViewer<'r> {
impl<'r> MapViewer<'r> {
pub fn new(row: &'r [u8]) -> MapViewer<'r> {
- let key_byte_size = LittleEndian::read_u64(&row[0..8]) as usize;
+ let Some(header) = row.get(0..8) else {
+ return MapViewer {
+ key_row: &[],
+ value_row: &[],
+ };
+ };
+ let key_byte_size = LittleEndian::read_u64(header) as usize;
+ let key_end = (8usize).saturating_add(key_byte_size).min(row.len());
Review Comment:
ditto here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]