if (rec==NULL)
return TRP_BADTYPE;
+ if ((trp_inforec_get_comm(rec)==NULL)
+ || (trp_inforec_get_realm(rec)==NULL)
+ || (trp_inforec_get_trust_router(rec)==NULL)) {
+ return TRP_ERROR;
+ }
+
s=tr_name_strdup(trp_inforec_get_comm(rec));
if (s==NULL)
return TRP_NOMEM;
json_t *jbody=NULL;
json_t *jstr=NULL;
char *s=NULL;
+ TR_NAME *n=NULL;
if (req==NULL)
return NULL;
if (jbody==NULL)
return NULL;
- s=tr_name_strdup(trp_req_get_comm(req)); /* ensures null termination */
+ if ((NULL==trp_req_get_comm(req))
+ || (NULL==trp_req_get_realm(req))) {
+ json_decref(jbody);
+ return NULL;
+ }
+
+ s=tr_name_strdup(n); /* ensures null termination */
if (s==NULL) {
json_decref(jbody);
return NULL;