]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
ntp_crypto.c:
authorPoul-Henning Kamp <phk@ntp.org>
Sat, 28 Jun 2014 06:19:58 +0000 (06:19 +0000)
committerPoul-Henning Kamp <phk@ntp.org>
Sat, 28 Jun 2014 06:19:58 +0000 (06:19 +0000)
  Don't assign stack variables to globals.

bk: 53ae5e8exgEy317nB0WL5ZAD50DI7A

ntpd/ntp_crypto.c

index 37a34f1cc86f02a2bc32ef8d32922a88a7b87cc6..0035c53cd2f01f76796087c1d37872d800df1e05 100644 (file)
@@ -3721,7 +3721,7 @@ crypto_setup(void)
        if (host_filename != NULL)
                strlcpy(hostname, host_filename, sizeof(hostname));
        if (passwd == NULL)
-               passwd = hostname;
+               passwd = estrdup(hostname);
        memset(&hostval, 0, sizeof(hostval));
        memset(&pubkey, 0, sizeof(pubkey));
        memset(&tai_leap, 0, sizeof(tai_leap));