[31562] in CVS-changelog-for-Kerberos-V5

home help back first fref pref prev next nref lref last post

krb5 commit: Fix deserializing context with missing profile

daemon@ATHENA.MIT.EDU (ghudson@mit.edu)
Thu Aug 6 22:08:56 2026

From: ghudson@mit.edu
To: cvs-krb5@mit.edu
Message-Id: <20260807020850.4658B101759@krbdev.mit.edu>
Date: Thu,  6 Aug 2026 22:08:50 -0400 (EDT)
MIME-Version: 1.0
Reply-To: krbdev@mit.edu
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu

https://github.com/krb5/krb5/commit/66f6fde30ec696437fecfddee778f0291a1d2ca1
commit 66f6fde30ec696437fecfddee778f0291a1d2ca1
Author: Sergey Bugaev <bugaevc@gmail.com>
Date:   Mon Jul 27 16:17:46 2026 +0300

    Fix deserializing context with missing profile
    
    k5_internalize_context() tolerates EINVAL and ENOENT failures from
    profile_ser_internalize(), which should allow it to continue if a
    configuration file (such as /etc/krb5.conf) is missing in the
    deserializing process.  However, profile_ser_internalize() only
    updates the caller's buffer pointer if the profile was initialized, so
    k5_internalize_context() attempts to read its trailer from the
    serialized profile data and fails.  Change profile_ser_internalize()
    to update the caller's buffer pointer once it has consumed a whole
    profile serialization, whether or not profile_init() succeeds.
    
    [ghudson@mit.edu: edited commit message and comment]
    
    ticket: 9231 (new)

 src/util/profile/prof_init.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/util/profile/prof_init.c b/src/util/profile/prof_init.c
index 783efbde2..b97d469a1 100644
--- a/src/util/profile/prof_init.c
+++ b/src/util/profile/prof_init.c
@@ -654,13 +654,13 @@ errcode_t profile_ser_internalize(profile_t *profilep,
         goto cleanup;
     }
 
-    if ((retval = profile_init((const_profile_filespec_t *) flist,
-                               profilep)))
-        goto cleanup;
-
+    /* Update the buffer pointer even if profile initialization fails, so the
+     * caller can keep deserializing from the correct position.  */
     *bufpp = bp;
     *remainp = remain;
 
+    retval = profile_init((const_profile_filespec_t *) flist, profilep);
+
 cleanup:
     if (flist) {
         for (i=0; i<fcount; i++) {
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5

home help back first fref pref prev next nref lref last post