mirror of https://github.com/openssl/openssl.git
Fix unnecessary casts between int and size_t
Also update a check for a negative int length value in mem_write(). Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/26438)
This commit is contained in:
parent
3e7afad062
commit
cb7da43fe8
|
@ -222,7 +222,7 @@ static int mem_write(BIO *b, const char *in, int inl)
|
|||
goto end;
|
||||
}
|
||||
BIO_clear_retry_flags(b);
|
||||
if (inl == 0)
|
||||
if (inl <= 0)
|
||||
return 0;
|
||||
if (in == NULL) {
|
||||
ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
|
||||
|
|
|
@ -672,7 +672,7 @@ int do_dtls1_write(SSL_CONNECTION *sc, uint8_t type, const unsigned char *buf,
|
|||
sc->rlayer.wrlmethod->write_records(sc->rlayer.wrl, &tmpl, 1));
|
||||
|
||||
if (ret > 0)
|
||||
*written = (int)len;
|
||||
*written = len;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -547,7 +547,7 @@ static int grow_init_buf(SSL_CONNECTION *s, size_t size) {
|
|||
|
||||
size_t msg_offset = (char *)s->init_msg - s->init_buf->data;
|
||||
|
||||
if (!BUF_MEM_grow_clean(s->init_buf, (int)size))
|
||||
if (!BUF_MEM_grow_clean(s->init_buf, size))
|
||||
return 0;
|
||||
|
||||
if (size < msg_offset)
|
||||
|
|
Loading…
Reference in New Issue