gss: Fix warnings

This commit is contained in:
Nicolas Williams
2021-03-27 23:28:17 -05:00
parent 65caff79a3
commit 96b7ea671d
14 changed files with 58 additions and 32 deletions

View File

@@ -262,8 +262,7 @@ gss_import_cred(OM_uint32 * minor_status,
goto out;
}
if (m->gm_import_cred == NULL &&
!gss_oid_equal(&m->gm_mech_oid, GSS_SPNEGO_MECHANISM)) {
if (m->gm_import_cred == NULL) {
*minor_status = 0;
major = GSS_S_BAD_MECH;
goto out;
@@ -287,8 +286,7 @@ gss_import_cred(OM_uint32 * minor_status,
continue;
}
major = m->gm_import_cred(minor_status,
&buffer, &mcred);
major = m->gm_import_cred(minor_status, &buffer, &mcred);
gss_release_buffer(&junk, &buffer);
if (major != GSS_S_COMPLETE)
goto out;

View File

@@ -72,6 +72,10 @@ gss_export_sec_context(OM_uint32 *minor_status,
verflags |= EXPORT_CONTEXT_FLAG_MECH_CTX;
kret = krb5_store_uint8(sp, verflags);
if (kret) {
*minor_status = kret;
goto failure;
}
if (ctx->gc_target_len) {
_gss_mg_log(10, "gss-esc: exporting partial token %zu/%zu",

View File

@@ -133,7 +133,7 @@ _gss_import_export_name(OM_uint32 *minor_status,
len -= t;
t = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
p += 4;
/* p += 4; // we're done using `p' now */
len -= 4;
if (len != t)

View File

@@ -42,9 +42,9 @@ gss_import_sec_context(OM_uint32 *minor_status,
_gss_mg_log(10, "gss-isc called");
if (!minor_status || !context_handle) {
if (!context_handle) {
*minor_status = EFAULT;
return GSS_S_FAILURE;
return GSS_S_CALL_INACCESSIBLE_WRITE;
}
*minor_status = 0;
@@ -87,7 +87,7 @@ gss_import_sec_context(OM_uint32 *minor_status,
if (ret != GSS_S_COMPLETE)
goto failure;
ctx->gc_input.value = calloc(target_len, 1);
ctx->gc_free_this = ctx->gc_input.value = calloc(target_len, 1);
if (ctx->gc_input.value == NULL)
goto failure;

View File

@@ -520,7 +520,8 @@ gss_krb5_ccache_name(OM_uint32 *minor_status,
}
}
*out_name = args.out_name;
if (out_name)
*out_name = args.out_name;
return major_status;
}

View File

@@ -137,6 +137,8 @@ _gss_string_to_oid(const char* s, gss_OID *oidp)
}
}
}
if (byte_count == 0)
return EINVAL;
if (!res) {
res = malloc(byte_count);
if (!res)

View File

@@ -158,6 +158,10 @@ gss_pname_to_uid(OM_uint32 *minor_status,
major = gss_localname(minor_status, pname, mech_type, &localname);
if (GSS_ERROR(major))
return major;
if (localname.length == 0) {
*minor_status = KRB5_NO_LOCALNAME;
return GSS_S_FAILURE;
}
szLocalname = malloc(localname.length + 1);
if (szLocalname == NULL) {