* def_realm.c (krb5_get_default_realm): Check that we have
authorDanilo Almeida <dalmeida@mit.edu>
Fri, 6 Aug 1999 16:07:04 +0000 (16:07 +0000)
committerDanilo Almeida <dalmeida@mit.edu>
Fri, 6 Aug 1999 16:07:04 +0000 (16:07 +0000)
a realm before trying to copy it (since profile_get_string
may return no error but not get anything).

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11629 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/os/ChangeLog
src/lib/krb5/os/def_realm.c

index 4ebcecbfa99551165d36479207285ef543873f62..3c4d885a1b8b2c1685eaed1fd017487ca655ac20 100644 (file)
@@ -1,5 +1,9 @@
 1999-08-06  Danilo Almeida  <dalmeida@mit.edu>
 
+       * def_realm.c (krb5_get_default_realm): Check that we have
+       a realm before trying to copy it (since profile_get_string
+       may return no error but not get anything).
+
        * init_os_ctx.c (krb5_get_profile): Fix calling convention.
 
 1999-08-05  Danilo Almeida  <dalmeida@mit.edu>
index 44a4e9381feb6fa174d059f302f0aed0f2eb6360..262b7792263021c0d80709bebda5eb42532c5b06 100644 (file)
@@ -76,7 +76,7 @@ krb5_get_default_realm(context, lrealm)
                                      "default_realm", 0, 0,
                                      &realm);
 
-        if (!retval) {
+        if (!retval && realm) {
             context->default_realm = malloc(strlen(realm) + 1);
             if (!context->default_realm) {
                 profile_release_string(realm);