Query
Relevant PR: github/codeql#5767
Report
the query finds the places where the variable is declared in the body of the loop. in situations where a similar variable is already used in a condition. my analysis showed that such coding methods are often used in various projects. however, these places do not always affect safety, the simplest example is the for loop.
therefore, I have as much as possible limited the request to identify situations that have a real impact on safety.
https://wiki.sei.cmu.edu/confluence/display/c/DCL01-C.+Do+not+reuse+variable+names+in+subscopes
Result(s)
sleuthkit/sleuthkit#2329
https://github.com/RediSearch/RediSearch/blob/efe031ea498ca4299064027641fad3b8f262ef6a/src/rmutil/util.c#L66
Query
Relevant PR: github/codeql#5767
Report
the query finds the places where the variable is declared in the body of the loop. in situations where a similar variable is already used in a condition. my analysis showed that such coding methods are often used in various projects. however, these places do not always affect safety, the simplest example is the
forloop.therefore, I have as much as possible limited the request to identify situations that have a real impact on safety.
https://wiki.sei.cmu.edu/confluence/display/c/DCL01-C.+Do+not+reuse+variable+names+in+subscopes
Result(s)
sleuthkit/sleuthkit#2329
https://github.com/RediSearch/RediSearch/blob/efe031ea498ca4299064027641fad3b8f262ef6a/src/rmutil/util.c#L66