from openbsd:

Correct some off-by-ones.  They currently don't matter, but this
is for future safety and consistency.
OK krw@, markus@
This commit is contained in:
itojun 2003-10-02 02:25:05 +00:00
parent 269a200e21
commit ae91503b5d
1 changed files with 3 additions and 3 deletions

View File

@ -73,7 +73,7 @@
#define SSL_ENC_NUM_IDX 9
static const EVP_CIPHER *ssl_cipher_methods[SSL_ENC_NUM_IDX]={
NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL
};
static STACK_OF(SSL_COMP) *ssl_comp_methods=NULL;
@ -245,7 +245,7 @@ int ssl_cipher_get_evp(SSL_SESSION *s, const EVP_CIPHER **enc,
break;
}
if ((i < 0) || (i > SSL_ENC_NUM_IDX))
if ((i < 0) || (i >= SSL_ENC_NUM_IDX))
*enc=NULL;
else
{
@ -267,7 +267,7 @@ int ssl_cipher_get_evp(SSL_SESSION *s, const EVP_CIPHER **enc,
i= -1;
break;
}
if ((i < 0) || (i > SSL_MD_NUM_IDX))
if ((i < 0) || (i >= SSL_MD_NUM_IDX))
*md=NULL;
else
*md=ssl_digest_methods[i];