33 */
44
55import cpp
6- import semmle.code.cpp.ir.dataflow.TaintTracking
76import DecompressionBomb
87
98/**
109 * The `ZSTD_decompress` function is used in flow sink.
1110 */
1211class ZstdDecompressFunction extends DecompressionFunction {
13- ZstdDecompressFunction ( ) { this .hasGlobalName ( [ "ZSTD_decompress" ] ) }
12+ ZstdDecompressFunction ( ) { this .hasGlobalName ( "ZSTD_decompress" ) }
1413
1514 override int getArchiveParameterIndex ( ) { result = 2 }
1615}
@@ -19,7 +18,7 @@ class ZstdDecompressFunction extends DecompressionFunction {
1918 * The `ZSTD_decompressDCtx` function is used in flow sink.
2019 */
2120class ZstdDecompressDctxFunction extends DecompressionFunction {
22- ZstdDecompressDctxFunction ( ) { this .hasGlobalName ( [ "ZSTD_decompressDCtx" ] ) }
21+ ZstdDecompressDctxFunction ( ) { this .hasGlobalName ( "ZSTD_decompressDCtx" ) }
2322
2423 override int getArchiveParameterIndex ( ) { result = 3 }
2524}
@@ -28,7 +27,7 @@ class ZstdDecompressDctxFunction extends DecompressionFunction {
2827 * The `ZSTD_decompressStream` function is used in flow sink.
2928 */
3029class ZstdDecompressStreamFunction extends DecompressionFunction {
31- ZstdDecompressStreamFunction ( ) { this .hasGlobalName ( [ "ZSTD_decompressStream" ] ) }
30+ ZstdDecompressStreamFunction ( ) { this .hasGlobalName ( "ZSTD_decompressStream" ) }
3231
3332 override int getArchiveParameterIndex ( ) { result = 2 }
3433}
@@ -37,19 +36,19 @@ class ZstdDecompressStreamFunction extends DecompressionFunction {
3736 * The `ZSTD_decompress_usingDDict` function is used in flow sink.
3837 */
3938class ZstdDecompressUsingDdictFunction extends DecompressionFunction {
40- ZstdDecompressUsingDdictFunction ( ) { this .hasGlobalName ( [ "ZSTD_decompress_usingDDict" ] ) }
39+ ZstdDecompressUsingDdictFunction ( ) { this .hasGlobalName ( "ZSTD_decompress_usingDDict" ) }
4140
4241 override int getArchiveParameterIndex ( ) { result = 3 }
4342}
4443
4544/**
4645 * The `fopen_orDie` function as a flow step.
4746 */
48- class FopenOrDieFunction extends DecompressionFlowStep {
49- FopenOrDieFunction ( ) { this . hasGlobalName ( "fopen_orDie" ) }
47+ class FopenOrDieFunctionStep extends DecompressionFlowStep {
48+ FopenOrDieFunctionStep ( ) { this = "FopenOrDieFunctionStep" }
5049
5150 override predicate isAdditionalFlowStep ( DataFlow:: Node node1 , DataFlow:: Node node2 ) {
52- exists ( FunctionCall fc | fc .getTarget ( ) = this |
51+ exists ( FunctionCall fc | fc .getTarget ( ) . hasGlobalName ( "fopen_orDie" ) |
5352 node1 .asIndirectExpr ( ) = fc .getArgument ( 0 ) and
5453 node2 .asExpr ( ) = fc
5554 )
@@ -59,11 +58,11 @@ class FopenOrDieFunction extends DecompressionFlowStep {
5958/**
6059 * The `fread_orDie` function as a flow step.
6160 */
62- class FreadOrDieFunction extends DecompressionFlowStep {
63- FreadOrDieFunction ( ) { this . hasGlobalName ( "fread_orDie" ) }
61+ class FreadOrDieFunctionStep extends DecompressionFlowStep {
62+ FreadOrDieFunctionStep ( ) { this = "FreadOrDieFunctionStep" }
6463
6564 override predicate isAdditionalFlowStep ( DataFlow:: Node node1 , DataFlow:: Node node2 ) {
66- exists ( FunctionCall fc | fc .getTarget ( ) = this |
65+ exists ( FunctionCall fc | fc .getTarget ( ) . hasGlobalName ( "fread_orDie" ) |
6766 node1 .asIndirectExpr ( ) = fc .getArgument ( 2 ) and
6867 node2 .asIndirectExpr ( ) = fc .getArgument ( 0 )
6968 )
0 commit comments