* server.c (log_badauth_display_status_1): Do not assume that
authorEzra Peisach <epeisach@mit.edu>
Thu, 7 Jun 2001 22:33:00 +0000 (22:33 +0000)
committerEzra Peisach <epeisach@mit.edu>
Thu, 7 Jun 2001 22:33:00 +0000 (22:33 +0000)
gss_buffer_desc strings are '\0' terminated.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13301 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/rpc/unit-test/ChangeLog
src/lib/rpc/unit-test/server.c

index a2f58f33fd201b4bd30faddcaccf6518a1001eb6..e8d21818dee13e96a0b53642c9869cf60ab76906 100644 (file)
@@ -1,3 +1,8 @@
+2001-06-07  Ezra Peisach  <epeisach@mit.edu>
+
+       * server.c (log_badauth_display_status_1): Do not assume that
+       gss_buffer_desc strings are '\0' terminated.
+
 2001-06-05  Ezra Peisach  <epeisach@mit.edu>
 
        * server.c (log_badauth_display_status_1): Need value element of
index cbf66197911b4bd892059abd084961619290ba01..5f2e4b9a5ef0de0768708699cccdce66a63f28d2 100644 (file)
@@ -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)