[PATCH 06/10] libsframe: check error condition in sframe_decode_fre

Indu Bhagat ibhagatgnu@gmail.com
Thu Aug 27 22:41:42 GMT 2026


The sframe_decode_fre_start_address API returns SFRAME_ERR in case of
invalid fre_type.  Check for return value and exit early.
---
 libsframe/sframe.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libsframe/sframe.c b/libsframe/sframe.c
index 51b6bf57c05..288d7c0d873 100644
--- a/libsframe/sframe.c
+++ b/libsframe/sframe.c
@@ -1408,7 +1408,9 @@ sframe_decode_fre (const char *fre_buf, sframe_frame_row_entry *fre,
     return sframe_set_errno (&err, SFRAME_ERR_INVAL);
 
   /* Copy over the FRE start address.  */
-  sframe_decode_fre_start_address (fre_buf, &fre->fre_start_addr, fre_type);
+  if (sframe_decode_fre_start_address (fre_buf, &fre->fre_start_addr,
+				       fre_type))
+    return sframe_set_errno (&err, SFRAME_ERR_INVAL);
 
   addr_size = sframe_fre_start_addr_size (fre_type);
   fre->fre_info = *(uint8_t *)(fre_buf + addr_size);
-- 
2.43.0



More information about the Binutils mailing list