From aff05e1be4075375708b13e58d0bd99fc12e10aa Mon Sep 17 00:00:00 2001 From: Matt Keeter Date: Tue, 5 May 2026 10:00:52 -0400 Subject: [PATCH] Fix udprpc hiffy backend deserialization --- humility-hiffy/src/lib.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/humility-hiffy/src/lib.rs b/humility-hiffy/src/lib.rs index 8443fa89..64e99fe1 100644 --- a/humility-hiffy/src/lib.rs +++ b/humility-hiffy/src/lib.rs @@ -697,9 +697,13 @@ impl<'a> HiffyContext<'a> { if code != 0 { return Err(Failure::FunctionError(code)); } - rval[0..nreply as usize] - .copy_from_slice(&buf[5..(5 + nreply as usize)]); + // The reply may be shorter than `nreply` bytes, if this is an Idol + // call that uses serialization for its return type. `buf` has + // already been trimmed based on actual reply length. + let reply = &buf[5..]; + rval[0..][..reply.len()].copy_from_slice(reply); + // Return the original `nreply`, to match the Hubris implementation Ok(nreply.try_into().unwrap()) } ////////////////////////////////////////////////////////////////////////