From: Arran Cudbard-Bell Date: Thu, 17 Nov 2022 23:41:50 +0000 (-0600) Subject: Don't SEGV at DEBUG3 when running SASL X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6791cb933177f38e7258382957fc006535ca1127;p=thirdparty%2Ffreeradius-server.git Don't SEGV at DEBUG3 when running SASL --- diff --git a/src/lib/ldap/sasl.c b/src/lib/ldap/sasl.c index 3ab369efae6..c2388509cbf 100644 --- a/src/lib/ldap/sasl.c +++ b/src/lib/ldap/sasl.c @@ -173,15 +173,23 @@ static void _ldap_sasl_bind_io_read(fr_event_list_t *el, int fd, UNUSED int flag return; } - DEBUG3("SASL response : %pV", fr_box_strvalue_len(srv_cred->bv_val, srv_cred->bv_len)); + /* + * Observed as NULL when doing EXTERNAL + * authentication. + */ + if (srv_cred->bv_val) DEBUG3("SASL response : %pV", + fr_box_strvalue_len(srv_cred->bv_val, srv_cred->bv_len)); ber_bvfree(srv_cred); /* * If we need to continue, wait until the * socket is writable, and then call * ldap_sasl_interactive_bind again. + * + * sasl_ctx->rmech may be NULL if there's + * nothing else to do. */ - DEBUG3("Continuing SASL mech %s...", sasl_ctx->rmech); + if (sasl_ctx->rmech) DEBUG3("Continuing SASL mech %s...", sasl_ctx->rmech); ret = fr_event_fd_insert(sasl_ctx, el, fd, NULL,