From: Ezra Peisach Date: Thu, 7 Jun 2001 22:33:00 +0000 (+0000) Subject: * server.c (log_badauth_display_status_1): Do not assume that X-Git-Tag: krb5-1.3-alpha1~1461 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=523f64c3ad9c310e05551c571f02a4649984a22e;p=krb5.git * server.c (log_badauth_display_status_1): Do not assume that gss_buffer_desc strings are '\0' terminated. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13301 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/rpc/unit-test/ChangeLog b/src/lib/rpc/unit-test/ChangeLog index a2f58f33f..e8d21818d 100644 --- a/src/lib/rpc/unit-test/ChangeLog +++ b/src/lib/rpc/unit-test/ChangeLog @@ -1,3 +1,8 @@ +2001-06-07 Ezra Peisach + + * server.c (log_badauth_display_status_1): Do not assume that + gss_buffer_desc strings are '\0' terminated. + 2001-06-05 Ezra Peisach * server.c (log_badauth_display_status_1): Need value element of diff --git a/src/lib/rpc/unit-test/server.c b/src/lib/rpc/unit-test/server.c index cbf661979..5f2e4b9a5 100644 --- a/src/lib/rpc/unit-test/server.c +++ b/src/lib/rpc/unit-test/server.c @@ -167,11 +167,11 @@ static void rpc_test_badverf(gss_name_t client, gss_name_t server, (void) gss_display_name(&minor_stat, client, &client_name, &type); (void) gss_display_name(&minor_stat, server, &server_name, &type); - printf("rpc_test server: bad verifier from %s at %s:%d for %s\n", - (char *) client_name.value, + printf("rpc_test server: bad verifier from %.*s at %s:%d for %.*s\n", + (int) client_name.length, (char *) client_name.value, inet_ntoa(rqst->rq_xprt->xp_raddr.sin_addr), ntohs(rqst->rq_xprt->xp_raddr.sin_port), - (char *) server_name.value); + (int) server_name.length, (char *) server_name.value); (void) gss_release_buffer(&minor_stat, &client_name); (void) gss_release_buffer(&minor_stat, &server_name); @@ -240,12 +240,13 @@ void log_badauth_display_status_1(OM_uint32 code, int type, int rec) log_badauth_display_status_1(minor_stat, GSS_C_MECH_CODE, 1); } else - printf("GSS-API authentication error %s: " - "recursive failure!\n", (char *)msg.value); + printf("GSS-API authentication error %.*s: " + "recursive failure!\n", (int) msg.length, + (char *)msg.value); return; } - printf(", %s", (char *)msg.value); + printf(", %.*s", (int) msg.length, (char *)msg.value); (void) gss_release_buffer(&minor_stat, &msg); if (!msg_ctx)