mirror of
https://github.com/github/codeql.git
synced 2026-01-30 06:42:57 +01:00
Note that fmt.Errorf returns non-nil
This enables recognising more guarding functions that return nil/non-nil conditional on a barrier guard.
This commit is contained in:
@@ -1285,6 +1285,8 @@ private predicate certainlyReturnsNonNil(Function f, FunctionOutput output) {
|
||||
(
|
||||
f.hasQualifiedName("errors", "New")
|
||||
or
|
||||
f.hasQualifiedName("fmt", "Errorf")
|
||||
or
|
||||
f in [Builtin::new(), Builtin::make()]
|
||||
or
|
||||
exists(FuncDecl fd | fd = f.getFuncDecl() |
|
||||
|
||||
Reference in New Issue
Block a user