krb5: Check asprintf return value
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
This commit is contained in:

committed by
Jeffrey Altman

parent
b8f8906822
commit
f1255da03c
@@ -430,11 +430,12 @@ krb5_init_creds_warn_user(krb5_context context,
|
|||||||
"suppress_weak_enctype", NULL);
|
"suppress_weak_enctype", NULL);
|
||||||
if (!suppress) {
|
if (!suppress) {
|
||||||
char *str = NULL, *p = NULL;
|
char *str = NULL, *p = NULL;
|
||||||
|
int aret;
|
||||||
krb5_enctype_to_string(context, weak_enctype, &str);
|
krb5_enctype_to_string(context, weak_enctype, &str);
|
||||||
|
|
||||||
(void)asprintf(&p, "Encryption type %s(%d) used for authentication is weak and will be deprecated",
|
aret = asprintf(&p, "Encryption type %s(%d) used for authentication is weak and will be deprecated",
|
||||||
str ? str : "unknown", weak_enctype);
|
str ? str : "unknown", weak_enctype);
|
||||||
if (p) {
|
if (aret >= 0 && p) {
|
||||||
(*ctx->prompter)(context, ctx->prompter_data, NULL, p, 0, NULL);
|
(*ctx->prompter)(context, ctx->prompter_data, NULL, p, 0, NULL);
|
||||||
free(p);
|
free(p);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user