Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from #23334)
  • Loading branch information
hlandau committed Apr 19, 2024
1 parent c4d3a0c commit e46533f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/internal/quic_port.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void ossl_quic_port_subtick(QUIC_PORT *port, QUIC_TICK_RESULT *r,
/* Returns the number of queued incoming channels. */
size_t ossl_quic_port_get_num_incoming_channels(const QUIC_PORT *port);

/* Returns 1 if incoming connections should currently be allowed. */
/* Sets if incoming connections should currently be allowed. */
void ossl_quic_port_set_allow_incoming(QUIC_PORT *port, int allow_incoming);

/* Returns 1 if we are using addressed mode on the read side. */
Expand Down
2 changes: 1 addition & 1 deletion ssl/quic/quic_obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int ossl_quic_obj_init(QUIC_OBJ *obj,
int is_event_leader = (engine != NULL);
int is_port_leader = (port != NULL);

if (!ossl_assert(!obj->init_done && obj != NULL && SSL_TYPE_IS_QUIC(type)
if (!ossl_assert(obj != NULL && !obj->init_done && SSL_TYPE_IS_QUIC(type)
&& (parent_obj == NULL || IS_QUIC(parent_obj))))
return 0;

Expand Down
7 changes: 4 additions & 3 deletions ssl/quic/quic_obj_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,14 @@ SSL_CONNECTION *ossl_quic_obj_get0_handshake_layer(QUIC_OBJ *obj);
static ossl_inline ossl_unused SSL *
ossl_quic_obj_get0_ssl(QUIC_OBJ *obj)
{
assert(obj->init_done);

/*
* ->ssl is guaranteed to have an offset of 0 but the NULL check here makes
* ubsan happy.
*/
return obj != NULL ? &obj->ssl : NULL;
if (!ossl_assert(obj != NULL))
return NULL;

return &obj->ssl;
}

/*
Expand Down

0 comments on commit e46533f

Please sign in to comment.