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

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

krb5 commit: Check for null *iter_p in profile_iterator()

daemon@ATHENA.MIT.EDU (Greg Hudson)
Thu Jan 15 11:56:52 2015

Date: Thu, 15 Jan 2015 11:56:48 -0500
From: Greg Hudson <ghudson@mit.edu>
Message-Id: <201501151656.t0FGumpK004157@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu

https://github.com/krb5/krb5/commit/9a343200d305e7c8df6e556d63afaee42194175f
commit 9a343200d305e7c8df6e556d63afaee42194175f
Author: Greg Hudson <ghudson@mit.edu>
Date:   Wed Jan 14 13:10:39 2015 -0500

    Check for null *iter_p in profile_iterator()
    
    In profile_iterator(), return PROF_MAGIC_ITERATOR if *iter_p is NULL,
    instead of dereferencing a null pointer, as we did prior to 1.10.
    Correct calling code will not trigger this case, but incorrect code
    has been reported in the field.
    
    ticket: 8059 (new)
    target_version: 1.13.1
    tags: pullup

 src/util/profile/prof_get.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/util/profile/prof_get.c b/src/util/profile/prof_get.c
index 3eba787..16a1762 100644
--- a/src/util/profile/prof_get.c
+++ b/src/util/profile/prof_get.c
@@ -579,7 +579,7 @@ profile_iterator(void **iter_p, char **ret_name, char **ret_value)
         *ret_name = NULL;
     if (ret_value)
         *ret_value = NULL;
-    if (iter->magic != PROF_MAGIC_ITERATOR)
+    if (iter == NULL || iter->magic != PROF_MAGIC_ITERATOR)
         return PROF_MAGIC_ITERATOR;
     profile = iter->profile;
 
_______________________________________________
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