From 2b9a352a3c850dac8636dacc4aa3a51e97bac272 Mon Sep 17 00:00:00 2001 From: Jim Garlick Date: Wed, 19 Apr 2017 17:08:14 -0700 Subject: [PATCH] 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. --- src/gssapi_client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gssapi_client.cpp b/src/gssapi_client.cpp index 6d7444cf..495f4ab0 100644 --- a/src/gssapi_client.cpp +++ b/src/gssapi_client.cpp @@ -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);