krb5 commit [krb5-1.9]: Fix various result checks

Tom Yu tlyu at MIT.EDU
Tue Apr 23 17:19:28 EDT 2013


https://github.com/krb5/krb5/commit/d527c811296e34062c2992d2be116ba22f884497
commit d527c811296e34062c2992d2be116ba22f884497
Author: Nickolai Zeldovich <nickolai at csail.mit.edu>
Date:   Fri Feb 22 18:52:21 2013 -0500

    Fix various result checks
    
    Correct three cases where the wrong expression was checked to see if
    an allocation function returned null.
    
    [ghudson at mit.edu: commit message, patch splitting]
    [tlyu at mit.edu: omit inapplicable lib/kadm/srv/svr_principal.c change]
    
    (back ported from commit a9ee4a040eeacab1d410ff9e4c862484b531c401)
    (cherry picked from commit 2ea07b055f1eb3abbb3a7b7206ab04ff190acf84)
    
    ticket: 7618
    version_fixed: 1.9.5
    status: resolved

 src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c      |    2 +-
 src/plugins/preauth/pkinit/pkinit_crypto_openssl.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c b/src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c
index 6874f47..c6fe04a 100644
--- a/src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c
+++ b/src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c
@@ -303,7 +303,7 @@ __get_bigkey(hashp, pagep, ndx, key)
 
 	key_pagep =
 	    __get_page(hashp, OADDR_TO_PAGE(DATA_OFF(pagep, ndx)), A_RAW);
-	if (!pagep)
+	if (!key_pagep)
 		return (-1);
 	key->size = collect_key(hashp, key_pagep, 0, NULL);
 	key->data = hashp->bigkey_buf;
diff --git a/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c b/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c
index 51103e8..fb85877 100644
--- a/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c
+++ b/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c
@@ -3248,7 +3248,7 @@ prepare_enc_data(unsigned char *indata,
     asn1_const_Finish(&c);
 
     *outdata = malloc((size_t)Tlen);
-    if (outdata == NULL) {
+    if (*outdata == NULL) {
         retval = ENOMEM;
         goto cleanup;
     }


More information about the cvs-krb5 mailing list