From 8129e65a2151321ce4b841fcac75823fd8dce3a4 Mon Sep 17 00:00:00 2001 From: Abraham Egnor Date: Wed, 21 Feb 2024 12:17:23 -0500 Subject: [PATCH] RUST-1850 Fix a fuzzer failure --- src/de/raw.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/de/raw.rs b/src/de/raw.rs index 874d025e..e338bf7d 100644 --- a/src/de/raw.rs +++ b/src/de/raw.rs @@ -1316,14 +1316,14 @@ impl<'de, 'a> CodeWithScopeDeserializer<'de, 'a> { F: FnOnce(&mut Self) -> Result, { let start_bytes = self.root_deserializer.bytes.bytes_read(); - let out = f(self); + let out = f(self)?; let bytes_read = self.root_deserializer.bytes.bytes_read() - start_bytes; self.length_remaining -= bytes_read as i32; if self.length_remaining < 0 { return Err(Error::custom("length of CodeWithScope too short")); } - out + Ok(out) } }