The branch main has been updated by cy:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=fce16f60de9718be6b789f00e86141a84cd920d3

commit fce16f60de9718be6b789f00e86141a84cd920d3
Author:     Cy Schubert <[email protected]>
AuthorDate: 2026-06-02 18:09:43 +0000
Commit:     Cy Schubert <[email protected]>
CommitDate: 2026-06-08 13:52:04 +0000

    krb5: Fix reachable assert when importing krb5 names
    
    If a name token contains trailing garbage, error out from
    krb5_gss_import_name() instead of crashing the process with an
    assertion failure.
    
    Commit message details obtained from upstream commit.
    Obtained from:  upstream commit 07818f1fd
    Reported by:    Aisle Research (Ze Sheng, Dmitrijs Trizna,
                    Luigino Camastra, Guido Vranken) to krb5-bugs
    MFC after:      3 days
---
 crypto/krb5/src/lib/gssapi/krb5/import_name.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/crypto/krb5/src/lib/gssapi/krb5/import_name.c 
b/crypto/krb5/src/lib/gssapi/krb5/import_name.c
index a067d0742331..b4c29b442511 100644
--- a/crypto/krb5/src/lib/gssapi/krb5/import_name.c
+++ b/crypto/krb5/src/lib/gssapi/krb5/import_name.c
@@ -297,7 +297,8 @@ import_name(OM_uint32 *minor_status, gss_buffer_t 
input_name_buffer,
                     goto fail_name;
                 cp += length;
             }
-            assert(cp == end);
+            if (cp != end)
+               goto fail_name;
         } else {
             status = GSS_S_BAD_NAMETYPE;
             goto cleanup;

Reply via email to