Fail safe in case krb5_os_localaddr returns NULL
authorTheodore Tso <tytso@mit.edu>
Thu, 2 Jun 1994 16:37:07 +0000 (16:37 +0000)
committerTheodore Tso <tytso@mit.edu>
Thu, 2 Jun 1994 16:37:07 +0000 (16:37 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3666 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/crypto/des/new_rn_key.c

index 2d34df19d95abea9d031e522e64e1d1b8537252f..3a884cca5ed88cef6a089de13964aa77e809d4c1 100644 (file)
@@ -94,14 +94,14 @@ void mit_des_init_random_number_generator(key,p_seed)
     } timenow;
     mit_des_cblock new_key;
 
-    krb5_address **addrs;
+    krb5_address **addrs = 0;
 
     /*
      * use a host id in generating the seed to ensure
      * that different servers have different streams:
      */
     memset((char *)seed, 0, sizeof(seed));
-    if (!krb5_os_localaddr(&addrs) && *addrs) {
+    if (!krb5_os_localaddr(&addrs) && addrs && *addrs) {
        memcpy((char *)seed, (char *)addrs[0]->contents,
              min(sizeof(seed), addrs[0]->length));
        /* XXX may not do all of the seed. */