Skip to content
This repository was archived by the owner on Oct 1, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/tlshd/quic.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,16 +360,21 @@ static int quic_session_set_priority(gnutls_session_t session, uint32_t cipher)
static int quic_session_set_alpns(gnutls_session_t session, char *alpn_data)
{
gnutls_datum_t alpns[TLSHD_QUIC_MAX_ALPNS_LEN / 2];
char *alpn = strtok(alpn_data, ",");
char *saveptr = NULL;
char *alpn = strtok_r(alpn_data, ",", &saveptr);
int count = 0, ret;

while (alpn) {
while (*alpn == ' ')
alpn++;
if (count == TLSHD_QUIC_MAX_ALPNS_LEN / 2) {
tlshd_log_error("Too many ALPNs configured");
return -1;
}
alpns[count].data = (unsigned char *)alpn;
alpns[count].size = strlen(alpn);
count++;
alpn = strtok(NULL, ",");
alpn = strtok_r(NULL, ",", &saveptr);
}

ret = gnutls_alpn_set_protocols(session, alpns, count, GNUTLS_ALPN_MANDATORY);
Expand Down
2 changes: 1 addition & 1 deletion src/tlshd/tags.c
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,7 @@ tlshd_tags_filter_type_match_x509_tbs_version(struct tlshd_tags_filter *filter,
goto deinit;
}

snprintf(version, sizeof(version), "%u", ret);
snprintf(version, sizeof(version), "%d", ret);
res = tlshd_tags_filter_type_match_string(filter, version);
tlshd_log_debug("Filter '%s' %s version '%s'",
filter->fi_name,
Expand Down
Loading