If the canned string is "", its no use to the user, make it fall back

to the default error string.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21248 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2007-06-21 00:45:13 +00:00
parent b75978e41d
commit ca53ee4e11

View File

@@ -79,7 +79,7 @@ _gss_mg_get_error(const gss_OID mech, OM_uint32 type,
switch (type) { switch (type) {
case GSS_C_GSS_CODE: { case GSS_C_GSS_CODE: {
if (value != mg->maj_stat) if (value != mg->maj_stat || mg->maj_error.length == 0)
break; break;
string->value = malloc(mg->maj_error.length); string->value = malloc(mg->maj_error.length);
string->length = mg->maj_error.length; string->length = mg->maj_error.length;
@@ -87,7 +87,7 @@ _gss_mg_get_error(const gss_OID mech, OM_uint32 type,
return GSS_S_COMPLETE; return GSS_S_COMPLETE;
} }
case GSS_C_MECH_CODE: { case GSS_C_MECH_CODE: {
if (value != mg->min_stat) if (value != mg->min_stat || mg->min_error.length == 0)
break; break;
string->value = malloc(mg->min_error.length); string->value = malloc(mg->min_error.length);
string->length = mg->min_error.length; string->length = mg->min_error.length;