From: Hugo Landau Date: Thu, 27 Jul 2023 14:56:19 +0000 (+0100) Subject: QUIC TEST: Coverity - Ensure stream names are non-NULL X-Git-Tag: openssl-3.2.0-alpha1~240 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dbf247ad1dd0fc4c7b365593a9a5c69fc94a3732;p=thirdparty%2Fopenssl.git QUIC TEST: Coverity - Ensure stream names are non-NULL Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/21565) --- diff --git a/test/quic_multistream_test.c b/test/quic_multistream_test.c index fbe47b48850..eef32d4f580 100644 --- a/test/quic_multistream_test.c +++ b/test/quic_multistream_test.c @@ -1126,6 +1126,9 @@ static int run_script_worker(struct helper *h, const struct script_op *script, if (!TEST_ptr_null(c_tgt)) goto out; /* don't overwrite existing stream with same name */ + if (!TEST_ptr(op->stream_name)) + goto out; + if (!TEST_ptr(c_stream = ossl_quic_detach_stream(h->c_conn))) goto out; @@ -1139,6 +1142,9 @@ static int run_script_worker(struct helper *h, const struct script_op *script, if (!TEST_ptr(c_tgt)) goto out; + if (!TEST_ptr(op->stream_name)) + goto out; + if (!TEST_true(ossl_quic_attach_stream(h->c_conn, c_tgt))) goto out; @@ -1155,6 +1161,9 @@ static int run_script_worker(struct helper *h, const struct script_op *script, if (!TEST_ptr_null(c_tgt)) goto out; /* don't overwrite existing stream with same name */ + if (!TEST_ptr(op->stream_name)) + goto out; + if (op->arg1 != 0) flags |= SSL_STREAM_FLAG_UNI; @@ -1178,6 +1187,9 @@ static int run_script_worker(struct helper *h, const struct script_op *script, if (!TEST_uint64_t_eq(s_stream_id, UINT64_MAX)) goto out; /* don't overwrite existing stream with same name */ + if (!TEST_ptr(op->stream_name)) + goto out; + if (!TEST_true(ossl_quic_tserver_stream_new(h->s, op->arg1 > 0, &stream_id))) @@ -1200,6 +1212,9 @@ static int run_script_worker(struct helper *h, const struct script_op *script, if (!TEST_ptr_null(c_tgt)) goto out; /* don't overwrite existing stream with same name */ + if (!TEST_ptr(op->stream_name)) + goto out; + if ((c_stream = SSL_accept_stream(h->c_conn, 0)) == NULL) SPIN_AGAIN(); @@ -1216,6 +1231,9 @@ static int run_script_worker(struct helper *h, const struct script_op *script, if (!TEST_uint64_t_eq(s_stream_id, UINT64_MAX)) goto out; + if (!TEST_ptr(op->stream_name)) + goto out; + new_stream_id = ossl_quic_tserver_pop_incoming_stream(h->s); if (new_stream_id == UINT64_MAX) SPIN_AGAIN(); @@ -1242,6 +1260,9 @@ static int run_script_worker(struct helper *h, const struct script_op *script, || !TEST_true(!SSL_is_connection(c_tgt))) goto out; + if (!TEST_ptr(op->stream_name)) + goto out; + if (!TEST_true(helper_local_set_c_stream(&hl, op->stream_name, NULL))) goto out; @@ -1340,6 +1361,9 @@ static int run_script_worker(struct helper *h, const struct script_op *script, if (!TEST_uint64_t_eq(s_stream_id, UINT64_MAX)) goto out; + if (!TEST_ptr(op->stream_name)) + goto out; + if (!TEST_true(helper_set_s_stream(h, op->stream_name, op->arg2))) goto out; } @@ -1350,6 +1374,9 @@ static int run_script_worker(struct helper *h, const struct script_op *script, if (!TEST_uint64_t_ne(s_stream_id, UINT64_MAX)) goto out; + if (!TEST_ptr(op->stream_name)) + goto out; + if (!TEST_true(helper_set_s_stream(h, op->stream_name, UINT64_MAX))) goto out; }