diff options
Diffstat (limited to 'cipher.c')
-rw-r--r-- | cipher.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -12,7 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include "includes.h" | 14 | #include "includes.h" |
15 | RCSID("$Id: cipher.c,v 1.20 2000/04/16 02:31:50 damien Exp $"); | 15 | RCSID("$Id: cipher.c,v 1.21 2000/05/30 03:44:52 damien Exp $"); |
16 | 16 | ||
17 | #include "ssh.h" | 17 | #include "ssh.h" |
18 | #include "cipher.h" | 18 | #include "cipher.h" |
@@ -178,7 +178,7 @@ ciphers_valid(const char *names) | |||
178 | char *p; | 178 | char *p; |
179 | int i; | 179 | int i; |
180 | 180 | ||
181 | if (strcmp(names, "") == 0) | 181 | if (names == NULL || strcmp(names, "") == 0) |
182 | return 0; | 182 | return 0; |
183 | ciphers = xstrdup(names); | 183 | ciphers = xstrdup(names); |
184 | for ((p = strtok(ciphers, CIPHER_SEP)); p; (p = strtok(NULL, CIPHER_SEP))) { | 184 | for ((p = strtok(ciphers, CIPHER_SEP)); p; (p = strtok(NULL, CIPHER_SEP))) { |
@@ -201,6 +201,8 @@ int | |||
201 | cipher_number(const char *name) | 201 | cipher_number(const char *name) |
202 | { | 202 | { |
203 | int i; | 203 | int i; |
204 | if (name == NULL) | ||
205 | return -1; | ||
204 | for (i = 0; i < sizeof(cipher_names) / sizeof(cipher_names[0]); i++) | 206 | for (i = 0; i < sizeof(cipher_names) / sizeof(cipher_names[0]); i++) |
205 | if (strcmp(cipher_names[i], name) == 0 && | 207 | if (strcmp(cipher_names[i], name) == 0 && |
206 | (cipher_mask() & (1 << i))) | 208 | (cipher_mask() & (1 << i))) |