diff options
Diffstat (limited to 'readconf.c')
-rw-r--r-- | readconf.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/readconf.c b/readconf.c index e3a1dd742..f62905c29 100644 --- a/readconf.c +++ b/readconf.c | |||
@@ -12,7 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include "includes.h" | 14 | #include "includes.h" |
15 | RCSID("$OpenBSD: readconf.c,v 1.60 2001/01/28 20:36:16 stevesk Exp $"); | 15 | RCSID("$OpenBSD: readconf.c,v 1.61 2001/02/08 14:39:36 deraadt Exp $"); |
16 | 16 | ||
17 | #include "ssh.h" | 17 | #include "ssh.h" |
18 | #include "xmalloc.h" | 18 | #include "xmalloc.h" |
@@ -717,6 +717,8 @@ initialize_options(Options * options) | |||
717 | void | 717 | void |
718 | fill_default_options(Options * options) | 718 | fill_default_options(Options * options) |
719 | { | 719 | { |
720 | int len; | ||
721 | |||
720 | if (options->forward_agent == -1) | 722 | if (options->forward_agent == -1) |
721 | options->forward_agent = 0; | 723 | options->forward_agent = 0; |
722 | if (options->forward_x11 == -1) | 724 | if (options->forward_x11 == -1) |
@@ -783,16 +785,18 @@ fill_default_options(Options * options) | |||
783 | options->protocol = SSH_PROTO_1|SSH_PROTO_2|SSH_PROTO_1_PREFERRED; | 785 | options->protocol = SSH_PROTO_1|SSH_PROTO_2|SSH_PROTO_1_PREFERRED; |
784 | if (options->num_identity_files == 0) { | 786 | if (options->num_identity_files == 0) { |
785 | if (options->protocol & SSH_PROTO_1) { | 787 | if (options->protocol & SSH_PROTO_1) { |
788 | len = 2 + strlen(_PATH_SSH_CLIENT_IDENTITY) + 1; | ||
786 | options->identity_files[options->num_identity_files] = | 789 | options->identity_files[options->num_identity_files] = |
787 | xmalloc(2 + strlen(_PATH_SSH_CLIENT_IDENTITY) + 1); | 790 | xmalloc(len); |
788 | sprintf(options->identity_files[options->num_identity_files++], | 791 | snprintf(options->identity_files[options->num_identity_files++], |
789 | "~/%.100s", _PATH_SSH_CLIENT_IDENTITY); | 792 | len, "~/%.100s", _PATH_SSH_CLIENT_IDENTITY); |
790 | } | 793 | } |
791 | if (options->protocol & SSH_PROTO_2) { | 794 | if (options->protocol & SSH_PROTO_2) { |
795 | len = 2 + strlen(_PATH_SSH_CLIENT_ID_DSA) + 1; | ||
792 | options->identity_files[options->num_identity_files] = | 796 | options->identity_files[options->num_identity_files] = |
793 | xmalloc(2 + strlen(_PATH_SSH_CLIENT_ID_DSA) + 1); | 797 | xmalloc(len); |
794 | sprintf(options->identity_files[options->num_identity_files++], | 798 | snprintf(options->identity_files[options->num_identity_files++], |
795 | "~/%.100s", _PATH_SSH_CLIENT_ID_DSA); | 799 | len, "~/%.100s", _PATH_SSH_CLIENT_ID_DSA); |
796 | } | 800 | } |
797 | } | 801 | } |
798 | if (options->escape_char == -1) | 802 | if (options->escape_char == -1) |