Fix crash if bad server name.
@@ -560,7 +560,7 @@ int quic_client(const char* ip_address_text, int server_port,
int ret = 0;
picoquic_quic_t* qclient = NULL;
picoquic_cnx_t* cnx_client = NULL;
- picoquic_demo_callback_ctx_t callback_ctx;
+ picoquic_demo_callback_ctx_t callback_ctx = { 0 };
uint64_t current_time = 0;
int is_name = 0;
size_t client_sc_nb = 0;
@@ -614,6 +614,7 @@ int quic_client(const char* ip_address_text, int server_port,
}
/* If needed, set ALPN and proposed version from tickets */
+ if (ret == 0) {
if (config->alpn == NULL || config->proposed_version == 0) {
char const* ticket_alpn;
uint32_t ticket_version;
@@ -631,6 +632,7 @@ int quic_client(const char* ip_address_text, int server_port,
}
}
}
+ }
if (ret == 0) {
if (config->alpn != NULL && (strcmp(config->alpn, "siduck") == 0 || strcmp(config->alpn, "siduck-00") == 0)) {
