gssapi: use gss_buffer_desc consistently

Problem: one call to gss_import_name() includes the terminating
NULL in a gss_buffer_desc.length, and one doesn't.

According to the examples at:
http://docs.oracle.com/cd/E19253-01/816-4863/overview-22/index.html
the NULL should be included in the length.

Solution:  Fix one case to include the terminating NULL in the length.
This commit is contained in:
Jim Garlick 2017-04-19 17:08:14 -07:00
parent 4e22dd0e97
commit 2b9a352a3c

View File

@ -173,7 +173,7 @@ int zmq::gssapi_client_t::initialize_context ()
// First time through, import service_name into target_name
if (target_name == GSS_C_NO_NAME) {
send_tok.value = service_name;
send_tok.length = strlen(service_name);
send_tok.length = strlen(service_name) + 1;
OM_uint32 maj = gss_import_name(&min_stat, &send_tok,
GSS_C_NT_HOSTBASED_SERVICE,
&target_name);