summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2019-01-22 15:12:54 +0200
committerToomas Soome <tsoome@me.com>2019-07-03 10:46:42 +0300
commit940daf74cfd1719bd901f346ef96e7a7e24f3d5f (patch)
tree884007a78aaf6f7403a0e4597522309b2dbda0ca /usr
parent41d4805f3c6abade283ec1c338ef8c94ef6f4fd4 (diff)
downloadillumos-joyent-940daf74cfd1719bd901f346ef96e7a7e24f3d5f.tar.gz
11163 mech_krb5: NULL pointer errors
Reviewed by: John Levon <john.levon@joyent.com> Approved by: Richard Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr')
-rw-r--r--usr/src/lib/gss_mechs/mech_krb5/crypto/des/afsstring2key.c2
-rw-r--r--usr/src/lib/gss_mechs/mech_krb5/krb5/keytab/kt_solaris.c4
-rw-r--r--usr/src/lib/gss_mechs/mech_krb5/krb5/krb/gic_keytab.c2
-rw-r--r--usr/src/lib/gss_mechs/mech_krb5/krb5/krb/vfy_increds.c18
-rw-r--r--usr/src/lib/gss_mechs/mech_krb5/mech/acquire_cred_with_pw.c2
-rw-r--r--usr/src/lib/gss_mechs/mech_krb5/mech/init_sec_context.c2
-rw-r--r--usr/src/lib/gss_mechs/mech_krb5/profile/prof_solaris.c6
7 files changed, 18 insertions, 18 deletions
diff --git a/usr/src/lib/gss_mechs/mech_krb5/crypto/des/afsstring2key.c b/usr/src/lib/gss_mechs/mech_krb5/crypto/des/afsstring2key.c
index 38a50d9e68..b61cc2ae79 100644
--- a/usr/src/lib/gss_mechs/mech_krb5/crypto/des/afsstring2key.c
+++ b/usr/src/lib/gss_mechs/mech_krb5/crypto/des/afsstring2key.c
@@ -382,7 +382,7 @@ char *afs_crypt(const char *pw, const char *salt,
for(i=0; i<66; i++)
block[i] = 0;
/* Solaris Kerberos */
- for(i=0; ((c= *pw) != NULL) && i<64; pw++){
+ for(i=0; ((c= *pw) != 0) && i<64; pw++){
for(j=0; j<7; j++, i++)
block[i] = (c>>(6-j)) & 01;
i++;
diff --git a/usr/src/lib/gss_mechs/mech_krb5/krb5/keytab/kt_solaris.c b/usr/src/lib/gss_mechs/mech_krb5/krb5/keytab/kt_solaris.c
index cbf9aa618b..ea6e8e2d86 100644
--- a/usr/src/lib/gss_mechs/mech_krb5/krb5/keytab/kt_solaris.c
+++ b/usr/src/lib/gss_mechs/mech_krb5/krb5/keytab/kt_solaris.c
@@ -213,7 +213,7 @@ krb5_kt_add_ad_entries(krb5_context ctx, char **sprincs_str, char *domain,
goto cleanup;
code = krb5_get_permitted_enctypes(ctx, &enctypes);
- if (code != 0 || *enctypes == NULL)
+ if (code != 0 || *enctypes == 0)
goto cleanup;
for (tprinc = sprincs_str; *tprinc; tprinc++) {
@@ -441,7 +441,7 @@ krb5_kt_ad_validate(krb5_context ctx, char *sprinc_str, uint_t flags,
goto cleanup;
code = krb5_get_permitted_enctypes(ctx, &enctypes);
- if (code != 0 || *enctypes == NULL)
+ if (code != 0 || *enctypes == 0)
goto cleanup;
if ((code = krb5_kt_start_seq_get(ctx, kt, &cursor)) != 0)
diff --git a/usr/src/lib/gss_mechs/mech_krb5/krb5/krb/gic_keytab.c b/usr/src/lib/gss_mechs/mech_krb5/krb5/krb/gic_keytab.c
index 24af0d668f..3f35f2f83b 100644
--- a/usr/src/lib/gss_mechs/mech_krb5/krb5/krb/gic_keytab.c
+++ b/usr/src/lib/gss_mechs/mech_krb5/krb5/krb/gic_keytab.c
@@ -72,7 +72,7 @@ krb5_get_as_key_keytab(
/* Solaris Kerberos */
if ((ret = krb5_kt_get_entry(context, keytab, client,
0, /* don't have vno available */
- etype, &kt_ent)) != NULL)
+ etype, &kt_ent)) != 0)
return(ret);
ret = krb5_copy_keyblock(context, &kt_ent.key, &kt_key);
diff --git a/usr/src/lib/gss_mechs/mech_krb5/krb5/krb/vfy_increds.c b/usr/src/lib/gss_mechs/mech_krb5/krb5/krb/vfy_increds.c
index d3720d3eaa..112b0999e7 100644
--- a/usr/src/lib/gss_mechs/mech_krb5/krb5/krb/vfy_increds.c
+++ b/usr/src/lib/gss_mechs/mech_krb5/krb5/krb/vfy_increds.c
@@ -19,18 +19,18 @@ krb5_cc_copy_creds_except(krb5_context context, krb5_ccache incc, krb5_ccache ou
flags = 0; /* turns off OPENCLOSE mode */
/* Solaris Kerberos */
- if ((code = krb5_cc_set_flags(context, incc, flags)) != NULL)
+ if ((code = krb5_cc_set_flags(context, incc, flags)) != 0)
return(code);
/* Solaris Kerberos */
- if ((code = krb5_cc_set_flags(context, outcc, flags)) != NULL)
+ if ((code = krb5_cc_set_flags(context, outcc, flags)) != 0)
return(code);
/* Solaris Kerberos */
- if ((code = krb5_cc_start_seq_get(context, incc, &cur)) != NULL)
+ if ((code = krb5_cc_start_seq_get(context, incc, &cur)) != 0)
goto cleanup;
/* Solaris Kerberos */
- while ((code = krb5_cc_next_cred(context, incc, &cur, &creds)) == NULL) {
+ while ((code = krb5_cc_next_cred(context, incc, &cur, &creds)) == 0) {
if (krb5_principal_compare(context, princ, creds.server))
continue;
@@ -165,11 +165,11 @@ krb5_verify_init_creds(krb5_context context,
if ((ret = krb5_cc_resolve(context, "MEMORY:rd_req", &ccache)))
goto cleanup;
/* Solaris Kerberos */
- if ((ret = krb5_cc_initialize(context, ccache, creds->client)) != NULL)
+ if ((ret = krb5_cc_initialize(context, ccache, creds->client)) != 0)
goto cleanup;
/* Solaris Kerberos */
- if ((ret = krb5_cc_store_cred(context, ccache, creds)) != NULL)
+ if ((ret = krb5_cc_store_cred(context, ccache, creds)) != 0)
goto cleanup;
/* set up for get_creds */
@@ -212,10 +212,10 @@ krb5_verify_init_creds(krb5_context context,
retcc = NULL;
/* Solaris Kerberos */
- if (((ret = krb5_cc_resolve(context, "MEMORY:rd_req2", &retcc)) != NULL) ||
- ((ret = krb5_cc_initialize(context, retcc, creds->client)) != NULL) ||
+ if (((ret = krb5_cc_resolve(context, "MEMORY:rd_req2", &retcc)) != 0) ||
+ ((ret = krb5_cc_initialize(context, retcc, creds->client)) != 0) ||
((ret = krb5_cc_copy_creds_except(context, ccache, retcc,
- creds->server)) != NULL)) {
+ creds->server)) != 0)) {
/* Solaris Kerberos */
if (retcc)
(void) krb5_cc_destroy(context, retcc);
diff --git a/usr/src/lib/gss_mechs/mech_krb5/mech/acquire_cred_with_pw.c b/usr/src/lib/gss_mechs/mech_krb5/mech/acquire_cred_with_pw.c
index 09b42f3050..0da6c032ab 100644
--- a/usr/src/lib/gss_mechs/mech_krb5/mech/acquire_cred_with_pw.c
+++ b/usr/src/lib/gss_mechs/mech_krb5/mech/acquire_cred_with_pw.c
@@ -124,7 +124,7 @@ krb5_gss_cred_id_rec *cred;
cred->ccache = NULL;
- if (password == NULL || password->length == NULL ||
+ if (password == NULL || password->length == 0 ||
password->value == NULL)
pw = strdup("");
else if (*((char *)password->value + (password->length - 1)) == '\0')
diff --git a/usr/src/lib/gss_mechs/mech_krb5/mech/init_sec_context.c b/usr/src/lib/gss_mechs/mech_krb5/mech/init_sec_context.c
index 8830894d4a..7a6c800ab0 100644
--- a/usr/src/lib/gss_mechs/mech_krb5/mech/init_sec_context.c
+++ b/usr/src/lib/gss_mechs/mech_krb5/mech/init_sec_context.c
@@ -1681,7 +1681,7 @@ get_default_cred(OM_uint32 *minor_status, void *ct, gss_cred_id_t *cred_handle)
KRB5_LOG0(KRB5_INFO, "get_default_cred() start\n");
/* Get the default cred for user */
- if (((major = kg_get_defcred(minor_status, cred_handle)) != NULL) &&
+ if (((major = kg_get_defcred(minor_status, cred_handle)) != 0) &&
GSS_ERROR(major)) {
/* If we're not root we're done */
diff --git a/usr/src/lib/gss_mechs/mech_krb5/profile/prof_solaris.c b/usr/src/lib/gss_mechs/mech_krb5/profile/prof_solaris.c
index 52365df4b3..96958c1408 100644
--- a/usr/src/lib/gss_mechs/mech_krb5/profile/prof_solaris.c
+++ b/usr/src/lib/gss_mechs/mech_krb5/profile/prof_solaris.c
@@ -797,7 +797,7 @@ errcode_t
__profile_validate(profile_t profile, int *val_err, char **val)
{
errcode_t code;
- register int c;
+ int c;
boolean_t found = FALSE;
char *default_realm = NULL, **realms = NULL, *tr = NULL;
char **trealms = NULL, **domains = NULL, **ret_vals = NULL;
@@ -812,7 +812,7 @@ __profile_validate(profile_t profile, int *val_err, char **val)
if (code == 0 && default_realm != NULL) {
tr = default_realm;
- while ((c = *tr++) != NULL) {
+ while ((c = *tr++) != 0) {
if (islower(c)) {
*val_err = 1;
*val = strdup(default_realm);
@@ -832,7 +832,7 @@ __profile_validate(profile_t profile, int *val_err, char **val)
for (trealms = realms; *trealms; trealms++) {
tr = *trealms;
- while ((c = *tr++) != NULL) {
+ while ((c = *tr++) != 0) {
if (islower(c)) {
*val_err = 2;
*val = strdup(*trealms);