From a806da18ad55c99cc4bb8f609015c39ab27d0b02 Mon Sep 17 00:00:00 2001 From: Indu Bhagat Date: Tue, 25 Nov 2025 20:46:08 -0800 Subject: [PATCH] libsframe: bugfix in flip_sframe A previous commit bdb0d62281a to make flip_fde version aware added a new argument for passing the remaning buffer size to the involved functions. Fix the passed value to the intended. libsframe/ * sframe.c (flip_sframe): Correct the passed value of buf size. --- libsframe/sframe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libsframe/sframe.c b/libsframe/sframe.c index 303ab077564..0dcc782b1f6 100644 --- a/libsframe/sframe.c +++ b/libsframe/sframe.c @@ -628,7 +628,7 @@ flip_sframe (char *frame_buf, size_t buf_size, uint32_t to_foreign) if (fdes >= buf_end) goto bad; - if (to_foreign && sframe_decode_fde (fdes, fdes - buf_end, ver, + if (to_foreign && sframe_decode_fde (fdes, buf_end - fdes, ver, &num_fres, &fre_type, &fre_offset, &fsz)) goto bad; @@ -638,7 +638,7 @@ flip_sframe (char *frame_buf, size_t buf_size, uint32_t to_foreign) fde_bytes_flipped += fsz; - if (!to_foreign && sframe_decode_fde (fdes, fdes - buf_end, ver, + if (!to_foreign && sframe_decode_fde (fdes, buf_end - fdes, ver, &num_fres, &fre_type, &fre_offset, &fsz)) goto bad; -- 2.47.3