krb5 commit [krb5-1.22]: Terminate HTTPS read buffer when allocating it

ghudson at mit.edu ghudson at mit.edu
Tue Nov 3 19:18:43 EST 2026


https://github.com/krb5/krb5/commit/edc6d32f1bf68f1b11c8c95926a19acb36297a35
commit edc6d32f1bf68f1b11c8c95926a19acb36297a35
Author: Alejandro Pacheco <alepacheco99 at gmail.com>
Date:   Thu Oct 15 15:02:14 2026 +0200

    Terminate HTTPS read buffer when allocating it
    
    In https_read_bytes(), terminate the reply buffer immediately after
    allocation, so that the strstr() call in service_https_read() is valid
    even if no chunks of data are received before the TLS layer reports
    end of stream.
    
    [ghudson at mit.edu: edited commit message; split off test case into
    separate commit]
    
    (cherry picked from commit f47a009e26c8a90465d7971cb5a37e5c33f7d379)
    
    ticket: 9725
    version_fixed: 1.22.3

 src/lib/krb5/os/sendto_kdc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/lib/krb5/os/sendto_kdc.c b/src/lib/krb5/os/sendto_kdc.c
index 9b51e95ae..38b52aff3 100644
--- a/src/lib/krb5/os/sendto_kdc.c
+++ b/src/lib/krb5/os/sendto_kdc.c
@@ -1313,6 +1313,7 @@ https_read_bytes(krb5_context context, struct conn_state *conn,
             }
             in->buf = tmp;
             in->bufsize = bufsize;
+            in->buf[in->pos] = '\0';
         }
 
         st = context->tls->read(context, conn->http.tls, &in->buf[in->pos],


More information about the cvs-krb5 mailing list