From: Jennifer Richards Date: Thu, 26 Apr 2018 20:51:33 +0000 (-0400) Subject: Correctly display RP realms in the 'show communities' response X-Git-Tag: 3.4.0~1^2~34^2~6 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=trust_router.git;a=commitdiff_plain;h=bad2cb03f82006fddc8e26fdca07e49613fb3bfc Correctly display RP realms in the 'show communities' response --- diff --git a/common/tr_comm_encoders.c b/common/tr_comm_encoders.c index 2655fe5..c33c604 100644 --- a/common/tr_comm_encoders.c +++ b/common/tr_comm_encoders.c @@ -179,9 +179,14 @@ static json_t *tr_comm_realms_to_json(TR_COMM_TABLE *ctable, TR_NAME *comm_name, realm_json = json_object(); OBJECT_SET_OR_FAIL(realm_json, "realm", tr_name_to_json_string(tr_realm_get_id(realm))); - memb = tr_comm_table_find_idp_memb(ctable, - tr_realm_get_id(realm), - comm_name); + memb = tr_comm_table_find_memb(ctable, + tr_realm_get_id(realm), + comm_name); + if (memb == NULL) { + /* This should not happen - there must be a matching membership if we + * believed the realm was in the community in the first place! */ + goto cleanup; + } OBJECT_SET_OR_FAIL(realm_json, "sources", tr_comm_memb_sources_to_json(memb)); json_array_append_new(jarray, realm_json);