summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/cipher.c
diff options
context:
space:
mode:
authorprovos <provos@openbsd.org>1999-09-30 18:41:24 +0000
committerprovos <provos@openbsd.org>1999-09-30 18:41:24 +0000
commit0baa5ece4289b6f9b3496ede802d034373a39f50 (patch)
tree614ee25389b7ae37518d0870053b98104e5822bd /usr.bin/ssh/cipher.c
parentless brain damage, get rid of 'no ' (diff)
downloadwireguard-openbsd-0baa5ece4289b6f9b3496ede802d034373a39f50.tar.xz
wireguard-openbsd-0baa5ece4289b6f9b3496ede802d034373a39f50.zip
deal with NULL in ciphernames
Diffstat (limited to 'usr.bin/ssh/cipher.c')
-rw-r--r--usr.bin/ssh/cipher.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/ssh/cipher.c b/usr.bin/ssh/cipher.c
index 817d9474ed1..8a5c92d689e 100644
--- a/usr.bin/ssh/cipher.c
+++ b/usr.bin/ssh/cipher.c
@@ -12,7 +12,7 @@ Created: Wed Apr 19 17:41:39 1995 ylo
*/
#include "includes.h"
-RCSID("$Id: cipher.c,v 1.9 1999/09/30 18:37:45 provos Exp $");
+RCSID("$Id: cipher.c,v 1.10 1999/09/30 18:41:24 provos Exp $");
#include "ssh.h"
#include "cipher.h"
@@ -149,7 +149,8 @@ unsigned int cipher_mask()
const
char *cipher_name(int cipher)
{
- if (cipher < 0 || cipher >= sizeof(cipher_names) / sizeof(cipher_names[0]))
+ if (cipher < 0 || cipher >= sizeof(cipher_names) / sizeof(cipher_names[0]) ||
+ cipher_names[cipher] == NULL)
fatal("cipher_name: bad cipher number: %d", cipher);
return cipher_names[cipher];
}