trailofbits / semgrep-rules

Semgrep queries developed by Trail of Bits.
GNU Affero General Public License v3.0
328 stars 32 forks source link

Fix/more anon race cond improvements #35

Closed hex0punk closed 1 year ago

hex0punk commented 1 year ago
    - pattern-not: |
        for $X, $Y := range ... {
          ...
          go func(..., $V, ...){
            ...
            $FOO(..., $V, ...)
            ...
          }(..., $Y, ...)
          ...
        }
    - pattern-not: |
        for $Y, $X := range ... {
          ...
          go func(..., $CP, ...){
            ...
            $CP(...)
            ...
          }($X)
          ...
        }
    - pattern-not: |
        for $X:=...;$Y;$Z {
          ...
          go func(..., $V, ...) {
            ...
            $FOO(..., $V,...)
            ...
          }(..., $X, ...)
          ...
        }