Additional patch from Christan Krause to handle asprintf better
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24041 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -66,10 +66,13 @@ gss_set_error (struct gss_state *gs, int min_stat)
|
|||||||
gs->mech_oid,
|
gs->mech_oid,
|
||||||
&msg_ctx,
|
&msg_ctx,
|
||||||
&status_string);
|
&status_string);
|
||||||
asprintf(&cstr, "%.*s", (int)status_string.length,
|
if (asprintf(&cstr, "%.*s", (int)status_string.length,
|
||||||
(const char *)status_string.value);
|
(const char *)status_string.value) >= 0) {
|
||||||
pop_auth_set_error(cstr);
|
pop_auth_set_error(cstr);
|
||||||
free(cstr);
|
free(cstr);
|
||||||
|
} else {
|
||||||
|
pop_auth_set_error("unknown error");
|
||||||
|
}
|
||||||
gss_release_buffer (&new_stat, &status_string);
|
gss_release_buffer (&new_stat, &status_string);
|
||||||
} while (!GSS_ERROR(ret) && msg_ctx != 0);
|
} while (!GSS_ERROR(ret) && msg_ctx != 0);
|
||||||
}
|
}
|
||||||
|
@@ -52,7 +52,7 @@ gss_print_errors (int min_stat)
|
|||||||
GSS_C_NO_OID,
|
GSS_C_NO_OID,
|
||||||
&msg_ctx,
|
&msg_ctx,
|
||||||
&status_string);
|
&status_string);
|
||||||
fprintf (stderr, "%.*s\n", (int)status_string.legnth,
|
fprintf (stderr, "%.*s\n", (int)status_string.length,
|
||||||
(char *)status_string.value);
|
(char *)status_string.value);
|
||||||
gss_release_buffer (&new_stat, &status_string);
|
gss_release_buffer (&new_stat, &status_string);
|
||||||
} while (!GSS_ERROR(ret) && msg_ctx != 0);
|
} while (!GSS_ERROR(ret) && msg_ctx != 0);
|
||||||
|
@@ -62,7 +62,7 @@ gss_print_errors (int min_stat)
|
|||||||
&msg_ctx,
|
&msg_ctx,
|
||||||
&status_string);
|
&status_string);
|
||||||
if (!GSS_ERROR(ret)) {
|
if (!GSS_ERROR(ret)) {
|
||||||
fprintf (stderr, "%.*s\n", (int)status_string.value,
|
fprintf (stderr, "%.*s\n", (int)status_string.length,
|
||||||
(char *)status_string.value);
|
(char *)status_string.value);
|
||||||
gss_release_buffer (&new_stat, &status_string);
|
gss_release_buffer (&new_stat, &status_string);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user