Skip to content

chore: Go 1.26, go-s7comm v0.9.0, SAST fixes and hardening - #15

Merged
boeboe merged 1 commit into
mainfrom
chore/go126-sast
Nov 3, 2026
Merged

boeboe merged 1 commit into
mainfrom
chore/go126-sast

Conversation

@boeboe

@boeboe boeboe commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Dependencies: go-s7comm v0.9.0, go-cotp v1.2.0, go-tpkt v1.1.0. go-s7comm v0.9.0 refuses addresses the S7ANY format cannot carry; before, write --db 65537 wrote to DB 1.
  • Go 1.26 minimum, go fix applied, CI on Go 1.26 and 1.27. The Makefile's golangci-lint pin moves to v2.15.0 (v2.11.3 cannot read Go 1.27 export data).
  • SAST (engineering make sast, low/low): 2 → 0 open. record creates its output 0600 (G302); replay, record and pcap-decode clean file paths (G304).
  • Exit code: a go-s7comm *client.ValidationError (nothing sent) exits 2 (usage) instead of 6 (protocol). Documented in docs/exitcodes.md and RELEASE.md.
  • Tests: read/write of DB 65537, offset 2097152 and a range ending past the S7ANY limit exit 2 and send no write; record file mode; fuzz targets FuzzReadTPKTFrame and FuzzLoadReplayScript.

Test plan

  • make check (lint, vet, govulncheck, race tests, per-package coverage floor), total coverage 98.4 %
  • make e2e
  • go vet for linux/386 and windows/amd64, build for linux/arm/v7
  • New fuzz targets 20 s each locally
  • make sast REPO=s7commctl SEVERITY=low CONFIDENCE=low REF=chore/go126-sast: PASS

🤖 Generated with Claude Code

- go 1.26, go-s7comm v0.9.0, go-cotp v1.2.0, go-tpkt v1.1.0; go fix.
- record creates its output 0600; replay, record and pcap-decode clean
  file paths (gosec G302, G304).
- A go-s7comm ValidationError exits 2 (usage) instead of 6.
- Tests: S7ANY range limits, record file mode, fuzz targets for TPKT
  frames read from a peer and for replay scripts.
- CI on Go 1.26 and 1.27; golangci-lint v2.15.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.95833% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/s7commctl/root.go 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@boeboe
boeboe merged commit c9f1827 into main Nov 3, 2026
21 checks passed
@boeboe
boeboe deleted the chore/go126-sast branch November 3, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant