Commit 13a8f660 authored by Kevin J. McCarthy's avatar Kevin J. McCarthy

Merge branch 'stable'

parents 29d6f261 f52ee2f7
Pipeline #20488385 passed with stages
in 14 minutes and 56 seconds
......@@ -59,7 +59,9 @@ static void print_gss_error(OM_uint32 err_maj, OM_uint32 err_min)
&status_string);
if (GSS_ERROR(maj_stat))
break;
strncpy(buf_maj, (char*) status_string.value, sizeof(buf_maj));
strfcpy(buf_maj, (char*) status_string.value, sizeof(buf_maj));
if (status_string.length < sizeof(buf_maj))
buf_maj[status_string.length] = '\0';
gss_release_buffer(&min_stat, &status_string);
maj_stat = gss_display_status (&min_stat,
......@@ -70,7 +72,9 @@ static void print_gss_error(OM_uint32 err_maj, OM_uint32 err_min)
&status_string);
if (!GSS_ERROR(maj_stat))
{
strncpy(buf_min, (char*) status_string.value, sizeof(buf_min));
strfcpy(buf_min, (char*) status_string.value, sizeof(buf_min));
if (status_string.length < sizeof(buf_min))
buf_min[status_string.length] = '\0';
gss_release_buffer(&min_stat, &status_string);
}
} while (!GSS_ERROR(maj_stat) && msg_ctx != 0);
......@@ -105,7 +109,7 @@ imap_auth_res_t imap_auth_gss (IMAP_DATA* idata, const char* method)
/* get an IMAP service ticket for the server */
snprintf (buf1, sizeof (buf1), "imap@%s", idata->conn->account.host);
request_buf.value = buf1;
request_buf.length = strlen (buf1) + 1;
request_buf.length = strlen (buf1);
maj_stat = gss_import_name (&min_stat, &request_buf, gss_nt_service_name,
&target_name);
if (maj_stat != GSS_S_COMPLETE)
......@@ -258,7 +262,7 @@ imap_auth_res_t imap_auth_gss (IMAP_DATA* idata, const char* method)
/* server decides if principal can log in as user */
strncpy (buf1 + 4, idata->conn->account.user, sizeof (buf1) - 4);
request_buf.value = buf1;
request_buf.length = 4 + strlen (idata->conn->account.user) + 1;
request_buf.length = 4 + strlen (idata->conn->account.user);
maj_stat = gss_wrap (&min_stat, context, 0, GSS_C_QOP_DEFAULT, &request_buf,
&cflags, &send_token);
if (maj_stat != GSS_S_COMPLETE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment