This is an automated email from the ASF dual-hosted git repository.
mgrigorov pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/avro.git
The following commit(s) were added to refs/heads/main by this push:
new 74486c790 AVRO-3964: Fix out-of-bounds panic (#2821)
74486c790 is described below
commit 74486c79049eca5c8805b68eed0504ba0705bf8a
Author: Alexander Stanovoy <[email protected]>
AuthorDate: Mon Mar 25 15:59:06 2024 +0400
AVRO-3964: Fix out-of-bounds panic (#2821)
Co-authored-by: Alexander Stanovoy <[email protected]>
---
lang/rust/avro/src/decode.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lang/rust/avro/src/decode.rs b/lang/rust/avro/src/decode.rs
index 86584d3e0..41c3f24ab 100644
--- a/lang/rust/avro/src/decode.rs
+++ b/lang/rust/avro/src/decode.rs
@@ -323,7 +323,7 @@ pub(crate) fn decode_internal<R: Read, S: Borrow<Schema>>(
Ok(if let Value::Int(raw_index) = decode_int(reader)? {
let index = usize::try_from(raw_index)
.map_err(|e| Error::ConvertI32ToUsize(e, raw_index))?;
- if (0..=symbols.len()).contains(&index) {
+ if (0..symbols.len()).contains(&index) {
let symbol = symbols[index].clone();
Value::Enum(raw_index as u32, symbol)
} else {