fix: address clawpatch security and reliability findings#6941
Merged
Conversation
WithoutPants
requested changes
Jun 11, 2026
- Swap defer order in main.go so f.Close() runs after pprof.StopCPUProfile() - Revert convertBaseFile/convertBaseFiles to use panic on unknown type (programming error, not runtime error) - Remove redundant generate-backend dependency from build-release (already fixed by stashapp#6990)
WithoutPants
requested changes
Jun 25, 2026
57c5d16 to
d580955
Compare
WithoutPants
approved these changes
Jun 26, 2026
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
Fixes several confirmed bugs and risk findings reported by clawpatch across the
phasherCLI,stashCLI, andMakefile.Changes
cmd/phasher/main.gogetPathswhenffmpegorffprobeis not found inPATH, instead of silently passing empty strings downstreamprintPhashto prevent a runtime panic on files without an extension (e.g.Makefile,README)cmd/stash/main.goinitProfilingnow returns(*os.File, error)so the caller can close the file descriptor afterpprof.StopCPUProfile; previously the fd was leaked for the entire process lifetimeinternal/api/models.goconvertBaseFilenow returns(BaseFile, error)instead of panicking on unknown file types, matching the pattern used byconvertVisualFileconvertBaseFilesupdated accordinglyMakefileinstalltarget: introducedSTASH_BINARYto track the actual binary name separately from the-oflag, preventing broken installs on both Unix and Windowsgenerate-backendas an explicit dependency ofbuild-releaseto prevent race conditions undermake -jcmd/stash/main_test.goTestStubwith real tests forexitError,recoverPanic, andinitLogTemp