fix(lint): устранить замечания golangci-lint + переход на dockers_v2
Проход lint (52 → 0): - vkauth/token: переименовать затенённый err (govet shadow x3) - udprelay/loop: явный _ = conn.Close() (errcheck x2) - captcha/manual: ReadHeaderTimeout + html.EscapeString (G112, G705) - proxy/tcpfwd: хелпер nonNegUint64 для байтовых счётчиков io.Copy (G115) - proxy/bondclient, wire/bondframe: bounds-проверки на len->uint16/uint32 - wire/srtpmimicry: задокументирована усечка RTP seq mod 2^16 - dnsdial/doh: bounds-проверка + binary.BigEndian.PutUint16 - captcha/slider: clamp luma до 255 перед конверсией uint8 - vkauth/types: обоснованный nolint для публичных учёток VK SDK Новый пакет internal/randx — Intn/IntN/Float64 на crypto/rand, drop-in замена math/rand. Мигрированы все места antifingerprint-jitter (~22) в captcha, slider, namegen, vkauth, udprelay. GoReleaser: - bump GORELEASER_VERSION v2.5.0 → v2.15.4 в Taskfile и обоих CI-workflow; текущий синтаксис .goreleaser.yaml (archives.ids, format_overrides.formats) требует v2.8+ - миграция dockers + docker_manifests → dockers_v2 (единый блок, multi-platform buildx); Dockerfile.goreleaser использует конвенцию ARG TARGETPLATFORM
This commit is contained in:
1 parent
f8bc3f54e5
commit
dd8233208c
20 files changed
+156
-109
No files matched your search
@@ -8,6 +8,7 @@ import (
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"io"
|
||||
"math"
|
||||
"net"
|
||||
"time"
|
||||
)
|
||||
@@ -78,10 +79,13 @@ func ParseHelloHeader(hdr []byte) (Hello, error) {
|
||||
}
|
||||
|
||||
func WriteFrame(w io.Writer, typ byte, seq uint64, data []byte) error {
|
||||
if uint64(len(data)) > math.MaxUint32 {
|
||||
return fmt.Errorf("bondframe: data too large: %d", len(data))
|
||||
}
|
||||
var hdr [13]byte
|
||||
hdr[0] = typ
|
||||
binary.BigEndian.PutUint64(hdr[1:9], seq)
|
||||
binary.BigEndian.PutUint32(hdr[9:13], uint32(len(data)))
|
||||
binary.BigEndian.PutUint32(hdr[9:13], uint32(len(data))) //nolint:gosec // bounded above
|
||||
if _, err := w.Write(hdr[:]); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user