mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
Merge pull request #3763 from adityasharad/java/training-example-brace
Fix training example syntax
This commit is contained in:
@@ -2,11 +2,11 @@ import cpp
|
||||
import semmle.code.cpp.dataflow.DataFlow
|
||||
import semmle.code.cpp.commons.Printf
|
||||
|
||||
class SourceNode extends DataFlow::Node { ... }
|
||||
class SourceNode extends DataFlow::Node { /* ... */ }
|
||||
|
||||
from FormattingFunction f, Call c, SourceNode src, DataFlow::Node arg
|
||||
where c.getTarget() = f and
|
||||
arg.asExpr() = c.getArgument(f.getFormatParameterIndex()) and
|
||||
DataFlow::localFlow(src, arg) and
|
||||
not src.asExpr() instanceof StringLiteral
|
||||
select arg, "Non-constant format string."
|
||||
select arg, "Non-constant format string."
|
||||
|
||||
@@ -3,10 +3,10 @@ import java
|
||||
class EmptyBlock extends Block {
|
||||
EmptyBlock() {
|
||||
this.getNumStmt() = 0
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
from IfStmt ifstmt
|
||||
where ifstmt.getThen() instanceof
|
||||
EmptyBlock
|
||||
select ifstmt
|
||||
select ifstmt
|
||||
|
||||
Reference in New Issue
Block a user