[PATCH 05/12] libsframe: adjust version check in sframe_header_sanity_check_p

Indu Bhagat indu.bhagat@oracle.com
Tue Jun 27 21:20:21 GMT 2023


libsframe/
	* sframe.c (sframe_header_sanity_check_p): Include
	SFRAME_VERSION_2.
---
 libsframe/sframe.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libsframe/sframe.c b/libsframe/sframe.c
index 7031cee50b8..6faae8d96ef 100644
--- a/libsframe/sframe.c
+++ b/libsframe/sframe.c
@@ -206,9 +206,10 @@ sframe_header_sanity_check_p (sframe_header *hp)
 {
   unsigned char all_flags = SFRAME_F_FDE_SORTED | SFRAME_F_FRAME_POINTER;
   /* Check preamble is valid.  */
-  if ((hp->sfh_preamble.sfp_magic != SFRAME_MAGIC)
-      || (hp->sfh_preamble.sfp_version != SFRAME_VERSION)
-      || ((hp->sfh_preamble.sfp_flags | all_flags) != all_flags))
+  if (hp->sfh_preamble.sfp_magic != SFRAME_MAGIC
+      || (hp->sfh_preamble.sfp_version != SFRAME_VERSION_1
+	  && hp->sfh_preamble.sfp_version != SFRAME_VERSION_2)
+      || (hp->sfh_preamble.sfp_flags | all_flags) != all_flags)
     return false;
 
   /* Check offsets are valid.  */
-- 
2.39.2



More information about the Binutils mailing list