CodeQL library for C/C++
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 deteremined. outputParamIndex is -1.

Import path

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