CPP: Remove the overlap between these two queries.

This commit is contained in:
Geoffrey White
2019-04-18 09:56:05 +01:00
parent ca6ba36d87
commit 57a4e52b47
2 changed files with 1 additions and 12 deletions

View File

@@ -28,12 +28,6 @@ class MallocCall extends FunctionCall
}
}
predicate terminationProblem(MallocCall malloc, string msg)
{
malloc.getAllocatedSize() instanceof StrlenCall and
msg = "This allocation does not include space to null-terminate the string."
}
predicate spaceProblem(FunctionCall append, string msg)
{
exists(MallocCall malloc, StrlenCall strlen, AddExpr add, FunctionCall insert, Variable buffer |
@@ -51,5 +45,5 @@ predicate spaceProblem(FunctionCall append, string msg)
}
from Expr problem, string msg
where terminationProblem(problem, msg) or spaceProblem(problem, msg)
where spaceProblem(problem, msg)
select problem, msg