]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix reachable assert when importing krb5 names 1518/head
authorGreg Hudson <ghudson@mit.edu>
Mon, 1 Jun 2026 12:59:34 +0000 (08:59 -0400)
committerGreg Hudson <ghudson@mit.edu>
Sun, 7 Jun 2026 23:48:42 +0000 (19:48 -0400)
If a name token contains trailing garbage, error out from
krb5_gss_import_name() instead of crashing the process with an
assertion failure.  Reported by Aisle Research (Ze Sheng, Dmitrijs
Trizna, Luigino Camastra, Guido Vranken).

ticket: 9217
tags: pullup
target_version: 1.22-next

src/lib/gssapi/krb5/import_name.c

index a067d07423310fb0486ff7a979e8a6b57d24fc90..9a27b1468a9f81dac9792bb9d694d7151b4e43bf 100644 (file)
@@ -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;