From: Indu Bhagat Date: Wed, 26 Nov 2025 04:46:08 +0000 (-0800) Subject: libsframe: bugfix in flip_sframe X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a806da18ad55c99cc4bb8f609015c39ab27d0b02;p=thirdparty%2Fbinutils-gdb.git 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. --- 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;