]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix potential PAC processing crash 1378/head
authorArjun <pkillarjun@protonmail.com>
Fri, 11 Oct 2024 03:22:52 +0000 (08:52 +0530)
committerGreg Hudson <ghudson@mit.edu>
Mon, 14 Oct 2024 16:29:42 +0000 (12:29 -0400)
An input to krb5_pac_parse() with a zero-length buffer at the end of
the PAC can cause an assertion failure in k5_pac_locate_buffer() due
to an off-by-one error.  Correct the assertion.

[ghudson@mit.edu: edited commit message]

ticket: 9144 (new)
tags: pullup
target_version: 1.21-next

src/lib/krb5/krb/pac.c

index 77adcd2726a00e899dce9f55152bb895a9ef6890..909196b8d6a244799dfbd1e37e09a9b3bc3b60ae 100644 (file)
@@ -146,7 +146,7 @@ k5_pac_locate_buffer(krb5_context context, const krb5_pac pac, uint32_t type,
     if (buffer == NULL)
         return ENOENT;
 
-    assert(buffer->offset < pac->data.length);
+    assert(buffer->offset <= pac->data.length);
     assert(buffer->size <= pac->data.length - buffer->offset);
 
     if (data_out != NULL)