Skip to content

Commit

Permalink
feat: don't store items >5MB
Browse files Browse the repository at this point in the history
related #68
  • Loading branch information
sentriz committed Nov 9, 2023
1 parent 24fafdc commit 594ca54
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cliphist.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ func store(in io.Reader, maxDedupeSearch, maxItems uint64) error {
if err != nil {
return fmt.Errorf("read stdin: %w", err)
}
if len(input) > 5*1e6 { // don't store >5MB
return nil
}

db, err := initDB()
if err != nil {
Expand Down

0 comments on commit 594ca54

Please sign in to comment.