]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
CID 101: pointer/array cleanup
authorHarlan Stenn <stenn@ntp.org>
Wed, 28 Oct 2009 08:47:47 +0000 (03:47 -0500)
committerHarlan Stenn <stenn@ntp.org>
Wed, 28 Oct 2009 08:47:47 +0000 (03:47 -0500)
bk: 4ae80533kAdFB1Sibr3Ns_AhXgbbIA

ChangeLog
ntpd/ntp_crypto.c

index de2f3bd6536c0216982fcaf78c96f49191a31261..0e6a5a049b3b2d27877bc03ce768b584ed4dc451 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* CID 101: pointer/array cleanup.
 (4.2.5p238-RC) 2009/10/27 Released by Harlan Stenn <stenn@ntp.org>
 * Changes from Dave Mills.
 * driver4.html updates from Dave Mills.
index 89d01891c378743f10d2a02cf3b09c2f7f682f5e..0bcbb2341b63bdcfbd43ea7fc470c5005c43b95d 100644 (file)
@@ -3692,32 +3692,32 @@ crypto_setup(void)
         * it back so the sequence does not repeat when we next restart.
         */
        if (!RAND_status()) {
-               if (rand_file == NULL)
-                       RAND_file_name(filename, MAXFILENAME);
-               else if (*rand_file == '/')
-                       strcpy(filename, rand_file);
-               else
+               if (rand_file == NULL) {
+                       RAND_file_name(rand_file, MAXFILENAME);
+               } else if (*rand_file != '/') {
                        snprintf(filename, MAXFILENAME, "%s/%s",
                            keysdir, rand_file);
-               if (filename == NULL) {
+                       rand_file = filename;
+               }
+               if (rand_file == NULL) {
                        msyslog(LOG_ERR,
                            "crypto_setup: seed file unknown name");
                        exit (-1);
                }
-               if ((bytes = RAND_load_file(filename, -1)) == 0) {
+               if ((bytes = RAND_load_file(rand_file, -1)) == 0) {
                        msyslog(LOG_ERR,
                            "crypto_setup: random seed file %s missing",
-                           filename);
+                           rand_file);
                        exit (-1);
                }
                get_systime(&seed);
                RAND_seed(&seed, sizeof(l_fp));
-               RAND_write_file(filename);
+               RAND_write_file(rand_file);
 #ifdef DEBUG
                if (debug)
                        printf(
                            "crypto_setup: OpenSSL version %lx random seed file %s bytes read %d\n",
-                           SSLeay(), filename, bytes);
+                           SSLeay(), rand_file, bytes);
 #endif
        }