From: Harlan Stenn Date: Wed, 28 Oct 2009 08:47:47 +0000 (-0500) Subject: CID 101: pointer/array cleanup X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4aefc97bcd736c6aceb0cc6e540399fee2ccf86;p=thirdparty%2Fntp.git CID 101: pointer/array cleanup bk: 4ae80533kAdFB1Sibr3Ns_AhXgbbIA --- diff --git a/ChangeLog b/ChangeLog index de2f3bd653..0e6a5a049b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ +* CID 101: pointer/array cleanup. (4.2.5p238-RC) 2009/10/27 Released by Harlan Stenn * Changes from Dave Mills. * driver4.html updates from Dave Mills. diff --git a/ntpd/ntp_crypto.c b/ntpd/ntp_crypto.c index 89d01891c3..0bcbb2341b 100644 --- a/ntpd/ntp_crypto.c +++ b/ntpd/ntp_crypto.c @@ -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 }