From e1c7ea17702860083a2f3ce878f3454d5f864f35 Mon Sep 17 00:00:00 2001 From: lifenjoiner Date: Fri, 3 Feb 2023 23:22:32 +0800 Subject: [PATCH 1/3] Make CodeQL happy (#2294) --- dnscrypt-proxy/xtransport.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dnscrypt-proxy/xtransport.go b/dnscrypt-proxy/xtransport.go index 21bc707e..28e5094a 100644 --- a/dnscrypt-proxy/xtransport.go +++ b/dnscrypt-proxy/xtransport.go @@ -503,7 +503,7 @@ func (xTransport *XTransport) Fetch( if xTransport.h3Transport != nil && !hasAltSupport { if alt, found := resp.Header["Alt-Svc"]; found { dlog.Debugf("Alt-Svc [%s]: [%s]", url.Host, alt) - altPort := uint16(port) + altPort := uint16(port & 0xffff) for i, xalt := range alt { for j, v := range strings.Split(xalt, ";") { if i > 8 || j > 16 { From 683aad75dad96e504df928cd28e6787ef68e2e86 Mon Sep 17 00:00:00 2001 From: lifenjoiner Date: Fri, 3 Feb 2023 23:23:57 +0800 Subject: [PATCH 2/3] Nits (#2293) --- dnscrypt-proxy/xtransport.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dnscrypt-proxy/xtransport.go b/dnscrypt-proxy/xtransport.go index 28e5094a..8cfdaa85 100644 --- a/dnscrypt-proxy/xtransport.go +++ b/dnscrypt-proxy/xtransport.go @@ -506,14 +506,14 @@ func (xTransport *XTransport) Fetch( altPort := uint16(port & 0xffff) for i, xalt := range alt { for j, v := range strings.Split(xalt, ";") { - if i > 8 || j > 16 { + if i >= 8 || j >= 16 { break } v = strings.TrimSpace(v) if strings.HasPrefix(v, "h3=\":") { v = strings.TrimPrefix(v, "h3=\":") v = strings.TrimSuffix(v, "\"") - if xAltPort, err := strconv.ParseUint(v, 10, 16); err == nil && xAltPort <= 65536 { + if xAltPort, err := strconv.ParseUint(v, 10, 16); err == nil && xAltPort <= 65535 { altPort = uint16(xAltPort) dlog.Debugf("Using HTTP/3 for [%s]", url.Host) break From 3517dec376c71201e9ce5e253ff889ed29faceb9 Mon Sep 17 00:00:00 2001 From: lifenjoiner Date: Fri, 3 Feb 2023 23:24:32 +0800 Subject: [PATCH 3/3] GitHub Actions: Deprecating save-state and set-output commands (#2295) --- .github/workflows/releases.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index 04dbca09..23be1d08 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -25,7 +25,7 @@ jobs: steps: - name: Get the version id: get_version - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT - name: Set up Go uses: actions/setup-go@v3