gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnurl] 66/254: krb5: use private buffer for temp string, n


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 66/254: krb5: use private buffer for temp string, not receive buffer
Date: Sat, 17 Jun 2017 16:51:38 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to annotated tag gnurl-7.54.1
in repository gnurl.

commit c79f4908d461cecaa9976099dcbb8a63b351f19e
Author: Daniel Stenberg <address@hidden>
AuthorDate: Tue Apr 25 14:37:45 2017 +0200

    krb5: use private buffer for temp string, not receive buffer
---
 lib/krb5.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/lib/krb5.c b/lib/krb5.c
index 067b0a577..69a35979a 100644
--- a/lib/krb5.c
+++ b/lib/krb5.c
@@ -164,6 +164,7 @@ krb5_auth(void *app_data, struct connectdata *conn)
   size_t base64_sz = 0;
   struct sockaddr_in **remote_addr =
     (struct sockaddr_in **)&conn->ip_addr->ai_addr;
+  char *stringp;
 
   if(getsockname(conn->sock[FIRSTSOCKET],
                  (struct sockaddr *)&conn->local_addr, &l) < 0)
@@ -193,16 +194,19 @@ krb5_auth(void *app_data, struct connectdata *conn)
         return -1;
     }
 
-    input_buffer.value = data->state.buffer;
-    input_buffer.length = snprintf(input_buffer.value, BUFSIZE, 
"address@hidden",
-                                   service, host);
+    stringp = aprintf("address@hidden", service, host);
+    if(!stringp)
+      return -2;
+
+    input_buffer.value = stringp;
+    input_buffer.length = strlen(stringp);
     maj = gss_import_name(&min, &input_buffer, GSS_C_NT_HOSTBASED_SERVICE,
                           &gssname);
+    free(stringp);
     if(maj != GSS_S_COMPLETE) {
       gss_release_name(&min, &gssname);
       if(service == srv_host) {
-        Curl_failf(data, "Error importing service name %s",
-                   input_buffer.value);
+        Curl_failf(data, "Error importing service name address@hidden", 
service, host);
         return AUTH_ERROR;
       }
       service = srv_host;

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]