We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ebaeedd commit eda8170Copy full SHA for eda8170
1 file changed
humility-hiffy/src/lib.rs
@@ -697,9 +697,13 @@ impl<'a> HiffyContext<'a> {
697
if code != 0 {
698
return Err(Failure::FunctionError(code));
699
}
700
- rval[0..nreply as usize]
701
- .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
702
+ // already been trimmed based on actual reply length.
703
+ let reply = &buf[5..];
704
+ rval[0..][..reply.len()].copy_from_slice(reply);
705
706
+ // Return the original `nreply`, to match the Hubris implementation
707
Ok(nreply.try_into().unwrap())
708
709
////////////////////////////////////////////////////////////////////////
0 commit comments