git: 6e563a1b6084 - main - libctf: Fix recursive descent into anonymous SOU fields

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Tue, 12 Apr 2022 21:38:11 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=6e563a1b608438504d963c2d7c70e50d2e75af46

commit 6e563a1b608438504d963c2d7c70e50d2e75af46
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-04-12 19:24:40 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-04-12 21:29:53 +0000

    libctf: Fix recursive descent into anonymous SOU fields
    
    PR:             262412
    Tested by:      dhw, gallatin
    Fixes:          a6fb86917362 ("libctf: Handle CTFv3 containers")
    MFC after:      3 days
    Sponsored by:   The FreeBSD Foundation
---
 cddl/contrib/opensolaris/common/ctf/ctf_types.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cddl/contrib/opensolaris/common/ctf/ctf_types.c b/cddl/contrib/opensolaris/common/ctf/ctf_types.c
index de8269659c29..a3fe0bba4a9d 100644
--- a/cddl/contrib/opensolaris/common/ctf/ctf_types.c
+++ b/cddl/contrib/opensolaris/common/ctf/ctf_types.c
@@ -818,8 +818,8 @@ _ctf_member_info(ctf_file_t *fp, ctf_id_t type, const char *name, ulong_t off,
 
 		ctf_get_ctm_info(fp, mp, size, &increment, &type, &offset,
 		    &name1);
-		if (name1 == NULL &&
-		    _ctf_member_info(fp, type, name1, offset + off, mip) == 0)
+		if (name1[0] == '\0' &&
+		    _ctf_member_info(fp, type, name, offset + off, mip) == 0)
 			return (0);
 		if (strcmp(name1, name) == 0) {
 			mip->ctm_type = type;