Fix bugs found in semgrep issue fixes#2069
Open
swell-agent wants to merge 6 commits intowavesplatform:fix-semgrep-issues-2from
Open
Fix bugs found in semgrep issue fixes#2069swell-agent wants to merge 6 commits intowavesplatform:fix-semgrep-issues-2from
swell-agent wants to merge 6 commits intowavesplatform:fix-semgrep-issues-2from
Conversation
- Fix wrong variable in error check (err -> acErr) in node.go - Remove incorrect error wrapping in symbols.go ParseTicker - Add unsigned underflow guard in chaincmp binary search - Propagate state close error via named return in statehash - Move timer.Reset after channel read in session keepaliveLoop - Restore SIGTERM handling in chaincmp signal.NotifyContext - Remove redundant url.Parse in addresses.go
- Reduce cognitive complexity of statehash run() by extracting parseFlags, setupFDLimits, openState, and compareAndSearch helpers - Fix variable shadowing in grpc server files and appender by renaming inner err variables (sErr, iErr, vErr) - Move nosemgrep comments to separate lines above code to fix line length violations (>120 chars) - Fix nosemgrep comments incorrectly placed inside raw string literals breaking JSON parsing in test files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Continues work on PR #1966 by fixing bugs and issues found during code review of the semgrep fixes branch.
Closes #2068
Fixes
pkg/node/node.go:125) —errors.Is(err, net.ErrClosed)checked the wrong variable (errfromListen()which is alwaysnilat that point). Changed toacErrfromAccept().cmd/wmd/internal/data/symbols.go:120) — Removed%wwrapping of an unrelated base58 parse error in the "unknown ticker" error message.cmd/chaincmp/chaincmp.go:227) — Added guard againstmiddle == 0underflow when computingstop = middle - 1withuint64.cmd/statehash/statehash.go) — Added named returnerranderrors.Jointo propagate state close errors instead of silently logging them.pkg/networking/session.go) — Movedtimer.Reset()from beforeselectto after<-timer.Ccase, following the canonical Go timer pattern.cmd/chaincmp/chaincmp.go) — Addedsyscall.SIGTERMtosignal.NotifyContextto restore graceful shutdown on SIGTERM (lost whensigterm.gowas deleted).pkg/client/addresses.go) — Removed unnecessary intermediateurl.Parsecall sincejoinUrlalready parses the path.Test plan
makecompletes without errorssemgrep cireturns only configuration-related warnings🤖 Generated with Claude Code