Skip to content

Commit 8f2fbd6

Browse files
committed
- Fix that malloc failure for ngtcp2_conn_server_new
cleans up reference that older ngtcp2 versions can leave. Thanks to Qifan Zhang, Palo Alto Networks, for the report.
1 parent b5909d8 commit 8f2fbd6

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

doc/Changelog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
- Fix that malloc failure in doq connection setup, does
2727
not crash in doq connection delete later. Thanks to Qifan
2828
Zhang, Palo Alto Networks, for the report.
29+
- Fix that malloc failure for ngtcp2_conn_server_new
30+
cleans up reference that older ngtcp2 versions can leave.
31+
Thanks to Qifan Zhang, Palo Alto Networks, for the report.
2932

3033
16 June 2026: Wouter
3134
- Fix to disallow $INCLUDE for secondary zones. Start up

services/listen_dnsport.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4881,6 +4881,7 @@ doq_conn_setup(struct doq_conn* conn, uint8_t* scid, size_t scidlen,
48814881
rv = ngtcp2_conn_server_new(&conn->conn, &scid_cid, &sv_scid, &path,
48824882
conn->version, &callbacks, &settings, &params, NULL, conn);
48834883
if(rv != 0) {
4884+
conn->conn = NULL;
48844885
lock_rw_unlock(&conn->table->conid_lock);
48854886
log_err("ngtcp2_conn_server_new failed: %s",
48864887
ngtcp2_strerror(rv));

testcode/doqclient.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,8 +1137,11 @@ static struct ngtcp2_conn* conn_client_setup(struct doq_client_data* data)
11371137
client_chosen_version, &cbs, &settings, &params,
11381138
NULL, /* ngtcp2_mem allocator, use default */
11391139
data /* callback argument */);
1140-
if(!conn) fatal_exit("could not ngtcp2_conn_client_new: %s",
1141-
ngtcp2_strerror(rv));
1140+
if(rv!=0) {
1141+
conn = NULL;
1142+
fatal_exit("could not ngtcp2_conn_client_new: %s",
1143+
ngtcp2_strerror(rv));
1144+
}
11421145
data->cc_algo = settings.cc_algo;
11431146
return conn;
11441147
}

0 commit comments

Comments
 (0)