krb5 commit: Avoid uninitialized data in t_prf.c

Tom Yu tlyu at mit.edu
Wed Feb 4 17:57:24 EST 2015


https://github.com/krb5/krb5/commit/b5143bdc766ad4819355ac2cd52f685ec5dafa16
commit b5143bdc766ad4819355ac2cd52f685ec5dafa16
Author: Tom Yu <tlyu at mit.edu>
Date:   Wed Feb 4 17:01:14 2015 -0500

    Avoid uninitialized data in t_prf.c
    
    In t_prf.c, make sure that the partially initialized, faked-up
    structures gss_union_ctx_id_desc and krb5_gss_ctx_id_rec are zeroed.
    This avoids uninitialized reads in gss_pseudo_random(), which can
    cause intermittent test failures on some platforms.
    
    ticket: 8072 (new)
    target_version: 1.13.1
    tags: pullup

 src/tests/gssapi/t_prf.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/tests/gssapi/t_prf.c b/src/tests/gssapi/t_prf.c
index 7f04899..082edff 100644
--- a/src/tests/gssapi/t_prf.c
+++ b/src/tests/gssapi/t_prf.c
@@ -124,8 +124,10 @@ main(int argc, char *argv[])
      * implementation.
      */
     context = (gss_ctx_id_t)&uctx;
+    memset(&uctx, 0, sizeof(uctx));
     uctx.mech_type = &mech_krb5;
     uctx.internal_ctx_id = (gss_ctx_id_t)&kgctx;
+    memset(&kgctx, 0, sizeof(kgctx));
     kgctx.k5_context = NULL;
     kgctx.established = 1;
     kgctx.have_acceptor_subkey = 1;


More information about the cvs-krb5 mailing list