CodeQL library for C/C++
codeql/cpp-all 0.12.11 (changelog, source)
Search

Predicate variadicFormatter

Holds if f is a function such as vprintf that has a format parameter and a variable argument list of type va_arg. formatParamIndex indicates the format parameter and type indicates the type of vprintf:

  • "" is a vprintf variant, outputParamIndex is -1.
  • "f" is a vfprintf variant, outputParamIndex indicates the output stream parameter.
  • "s" is a vsprintf variant, outputParamIndex indicates the output buffer parameter.
  • "?" if the type cannot be determined. outputParamIndex is -1.

Import path

import cpp
predicate variadicFormatter(Function f, string type, int formatParamIndex, int outputParamIndex)