From aa52218d22c19ba97720a69bfcbfe5e23586f6e9 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Tue, 25 Feb 2003 23:14:40 +0000 Subject: [PATCH] Handle NULL result_string->data returned from error in krb5_change_password(). The SAMDATA() macro in lib/krb5/krb/preauth2.c seems to already be fixed. KfM's kpasswd equivalent still needs to be dealt with. ticket: 1055 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15204 dc483132-0cff-0310-8789-dd5450dbe970 --- src/clients/kpasswd/ChangeLog | 4 ++++ src/clients/kpasswd/kpasswd.c | 3 ++- src/lib/krb5/krb/ChangeLog | 5 +++++ src/lib/krb5/krb/gic_pwd.c | 5 +++-- src/windows/cns/ChangeLog | 5 +++++ src/windows/cns/kpasswd.c | 3 ++- 6 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/clients/kpasswd/ChangeLog b/src/clients/kpasswd/ChangeLog index 676d0fdd7..1019de41c 100644 --- a/src/clients/kpasswd/ChangeLog +++ b/src/clients/kpasswd/ChangeLog @@ -1,3 +1,7 @@ +2003-02-25 Tom Yu + + * kpasswd.c (main): Don't pass a NULL pointer to printf(). + 2002-08-29 Ken Raeburn * Makefile.in: Revert $(S)=>/ change, for Windows support. diff --git a/src/clients/kpasswd/kpasswd.c b/src/clients/kpasswd/kpasswd.c index da66102da..b70687435 100644 --- a/src/clients/kpasswd/kpasswd.c +++ b/src/clients/kpasswd/kpasswd.c @@ -135,7 +135,8 @@ int main(int argc, char *argv[]) printf("%.*s%s%.*s\n", (int) result_code_string.length, result_code_string.data, result_string.length?": ":"", - (int) result_string.length, result_string.data); + (int) result_string.length, + result_string.data ? result_string.data : ""); exit(2); } diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 95da8d84a..036e8ed51 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,8 @@ +2003-02-25 Tom Yu + + * gic_pwd.c (krb5_get_init_creds_password): Don't pass a NULL + pointer to sprintf(). + 2003-02-14 Sam Hartman * preauth2.c (krb5_do_preauth): Sort incoming etype info based on diff --git a/src/lib/krb5/krb/gic_pwd.c b/src/lib/krb5/krb/gic_pwd.c index 7bc4d5a46..7b5e0bab3 100644 --- a/src/lib/krb5/krb/gic_pwd.c +++ b/src/lib/krb5/krb/gic_pwd.c @@ -261,8 +261,9 @@ krb5_get_init_creds_password(krb5_context context, krb5_creds *creds, krb5_princ sprintf(banner, "%.*s%s%.*s. Please try again.\n", (int) code_string.length, code_string.data, - result_string.length?": ":"", - (int) result_string.length, result_string.data); + result_string.length ? ": " : "", + (int) result_string.length, + result_string.data ? result_string.data : ""); krb5_xfree(code_string.data); krb5_xfree(result_string.data); diff --git a/src/windows/cns/ChangeLog b/src/windows/cns/ChangeLog index b7f6df475..54cfa75c4 100644 --- a/src/windows/cns/ChangeLog +++ b/src/windows/cns/ChangeLog @@ -1,3 +1,8 @@ +2003-02-25 Tom Yu + + * kpasswd.c (k5_change_password): Don't pass a NULL pointer to + sprintf(). + 2002-07-12 Ken Raeburn * cns.h: Don't define DEFINE_SOCKADDR. diff --git a/src/windows/cns/kpasswd.c b/src/windows/cns/kpasswd.c index 8d867f02d..3219ea2aa 100644 --- a/src/windows/cns/kpasswd.c +++ b/src/windows/cns/kpasswd.c @@ -82,7 +82,8 @@ k5_change_password(HWND hwnd, krb5_context context, char *user, char *realm, sprintf(*text, "%.*s%s%.*s", result_code_string.length, result_code_string.data, (result_string.length ? ": " : ""), - result_string.length, result_string.data); + result_string.length, + result_string.data ? result_string.data : ""); } return 0; -- 2.26.2