Handle NULL result_string->data returned from error in
authorTom Yu <tlyu@mit.edu>
Tue, 25 Feb 2003 23:14:40 +0000 (23:14 +0000)
committerTom Yu <tlyu@mit.edu>
Tue, 25 Feb 2003 23:14:40 +0000 (23:14 +0000)
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
src/clients/kpasswd/kpasswd.c
src/lib/krb5/krb/ChangeLog
src/lib/krb5/krb/gic_pwd.c
src/windows/cns/ChangeLog
src/windows/cns/kpasswd.c

index 676d0fdd7042b3738e565fac9e79b12c51155563..1019de41c9f5aada7fd1a17fca7f6af7e6172cc1 100644 (file)
@@ -1,3 +1,7 @@
+2003-02-25  Tom Yu  <tlyu@mit.edu>
+
+       * kpasswd.c (main): Don't pass a NULL pointer to printf().
+
 2002-08-29  Ken Raeburn  <raeburn@mit.edu>
 
        * Makefile.in: Revert $(S)=>/ change, for Windows support.
index da66102daf7aa6d65f9e21fbff6ed4ba0626e7cb..b706874351dd0a2b75593606eda1e9b3f65325e0 100644 (file)
@@ -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);
    }
 
index 95da8d84a39148de3e820fdfeb1b40ed596b369c..036e8ed5188d8c94760cceba91b4830e87c12dac 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-25  Tom Yu  <tlyu@mit.edu>
+
+       * gic_pwd.c (krb5_get_init_creds_password): Don't pass a NULL
+       pointer to sprintf().
+
 2003-02-14  Sam Hartman  <hartmans@mit.edu>
 
        * preauth2.c (krb5_do_preauth): Sort incoming etype info based on
index 7bc4d5a46dc07af5363a1d396511bcecfce4d3a9..7b5e0bab307e191cb2a5ac43590ab51e1a2aeee1 100644 (file)
@@ -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);
index b7f6df4750d2a13ff6fb4489d75fc684b09f4689..54cfa75c49fe5372a478d0efd530693fe7424228 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-25  Tom Yu  <tlyu@mit.edu>
+
+       * kpasswd.c (k5_change_password): Don't pass a NULL pointer to
+       sprintf().
+
 2002-07-12  Ken Raeburn  <raeburn@mit.edu>
 
        * cns.h: Don't define DEFINE_SOCKADDR.
index 8d867f02d821b93dcad616c91d3d755868bde9aa..3219ea2aa2f4406c4b398a8723b20226d667d82e 100644 (file)
@@ -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;