prebid / prebid-server

Open-source solution for running real-time advertising auctions in the cloud.
https://prebid.org/product-suite/prebid-server/
Apache License 2.0
403 stars 700 forks source link

Fix semgrep issue with dgryski Go ruleset #3719

Closed dmitris closed 2 weeks ago

dmitris commented 3 weeks ago

PR fixes the semgrep issue with the dgryski ruleset, rule https://github.com/dgryski/semgrep-go/blob/master/returnnil.yml by restructuring the error handling: return nil if the err from jsonConfigMergeClone.Unmarshal, otherwise make the return value as now.

┌────────────────┐
│ 1 Code Finding │
└────────────────┘

    util/jsonutil/merge.go
   ❯❯❱ Users.dsavints.gh.dgryski.semgrep-go.return-nil
          return nil instead of nil value

           34┆ if err != nil {
           35┆   return &errortypes.FailedToUnmarshal{
           36┆           Message: tryExtractErrorMessage(err),
           37┆   }
           38┆ }
           39┆ return err
dmitris commented 2 weeks ago

thanks again for all the reviews and approvals 😄 - please let me know if you would like me to rebase on trunk before merging.