[11/19] libctf, open: Fix enum error handling path

Message ID 20240730153707.168357-12-nick.alcock@oracle.com
State New
Headers
Series libctf: various bugfixes (including a write into freed memory), and loosen constraints on enums |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 fail Patch failed to apply

Commit Message

Nick Alcock July 30, 2024, 3:36 p.m. UTC
  This new error-handling path was not properly initializing the
fp's errno.

libctf/
	* ctf-open.c (init_static_types_internal): Set errno properly.
---
 libctf/ctf-open.c | 1 +
 1 file changed, 1 insertion(+)
  

Patch

diff --git a/libctf/ctf-open.c b/libctf/ctf-open.c
index fd6d36edc46..ab97cde3ebf 100644
--- a/libctf/ctf-open.c
+++ b/libctf/ctf-open.c
@@ -1066,6 +1066,7 @@  init_static_types_internal (ctf_dict_t *fp, ctf_header_t *cth,
 	  continue;
 
 	enum_err:
+	  ctf_set_errno (fp, err);
 	  ctf_next_destroy (i_constants);
 	  ctf_next_destroy (i);
 	  return ctf_errno (fp);