@@ -11,7 +11,7 @@ import semmle.code.cpp.models.interfaces.Alias
1111/**
1212 * The standard functions `printf`, `wprintf` and their glib variants.
1313 */
14- class Printf extends FormattingFunction , AliasFunction {
14+ private class Printf extends FormattingFunction , AliasFunction {
1515 Printf ( ) {
1616 this instanceof TopLevelFunction and
1717 (
@@ -31,6 +31,8 @@ class Printf extends FormattingFunction, AliasFunction {
3131 hasGlobalName ( "wprintf_s" )
3232 }
3333
34+ override predicate isOutputGlobal ( ) { any ( ) }
35+
3436 override predicate parameterNeverEscapes ( int n ) { n = 0 }
3537
3638 override predicate parameterEscapesOnlyViaReturn ( int n ) { none ( ) }
@@ -41,7 +43,7 @@ class Printf extends FormattingFunction, AliasFunction {
4143/**
4244 * The standard functions `fprintf`, `fwprintf` and their glib variants.
4345 */
44- class Fprintf extends FormattingFunction {
46+ private class Fprintf extends FormattingFunction {
4547 Fprintf ( ) {
4648 this instanceof TopLevelFunction and
4749 (
@@ -57,6 +59,8 @@ class Fprintf extends FormattingFunction {
5759 deprecated override predicate isWideCharDefault ( ) { hasGlobalOrStdName ( "fwprintf" ) }
5860
5961 override int getOutputParameterIndex ( ) { result = 0 }
62+
63+ override predicate isOutputStream ( ) { any ( ) }
6064}
6165
6266/**
@@ -232,12 +236,14 @@ private class StringCchPrintf extends FormattingFunction {
232236/**
233237 * The standard function `syslog`.
234238 */
235- class Syslog extends FormattingFunction {
239+ private class Syslog extends FormattingFunction {
236240 Syslog ( ) {
237241 this instanceof TopLevelFunction and
238242 hasGlobalName ( "syslog" ) and
239243 not exists ( getDefinition ( ) .getFile ( ) .getRelativePath ( ) )
240244 }
241245
242246 override int getFormatParameterIndex ( ) { result = 1 }
247+
248+ override predicate isOutputGlobal ( ) { any ( ) }
243249}
0 commit comments