@@ -9,44 +9,63 @@ import DecompressionBomb
9
9
/**
10
10
* The `ZSTD_decompress` function is used in flow sink.
11
11
*/
12
- class ZSTDDecompressFunction extends DecompressionFunction {
13
- ZSTDDecompressFunction ( ) { this .hasGlobalName ( [ "ZSTD_decompress" ] ) }
12
+ class ZstdDecompressFunction extends DecompressionFunction {
13
+ ZstdDecompressFunction ( ) { this .hasGlobalName ( [ "ZSTD_decompress" ] ) }
14
14
15
15
override int getArchiveParameterIndex ( ) { result = 2 }
16
16
}
17
17
18
18
/**
19
19
* The `ZSTD_decompressDCtx` function is used in flow sink.
20
20
*/
21
- class ZSTDDecompressDCtxFunction extends DecompressionFunction {
22
- ZSTDDecompressDCtxFunction ( ) { this .hasGlobalName ( [ "ZSTD_decompressDCtx" ] ) }
21
+ class ZstdDecompressDctxFunction extends DecompressionFunction {
22
+ ZstdDecompressDctxFunction ( ) { this .hasGlobalName ( [ "ZSTD_decompressDCtx" ] ) }
23
23
24
24
override int getArchiveParameterIndex ( ) { result = 3 }
25
25
}
26
26
27
27
/**
28
28
* The `ZSTD_decompressStream` function is used in flow sink.
29
29
*/
30
- class ZSTDDecompressStreamFunction extends DecompressionFunction {
31
- ZSTDDecompressStreamFunction ( ) { this .hasGlobalName ( [ "ZSTD_decompressStream" ] ) }
30
+ class ZstdDecompressStreamFunction extends DecompressionFunction {
31
+ ZstdDecompressStreamFunction ( ) { this .hasGlobalName ( [ "ZSTD_decompressStream" ] ) }
32
32
33
33
override int getArchiveParameterIndex ( ) { result = 2 }
34
34
}
35
35
36
36
/**
37
37
* The `ZSTD_decompress_usingDDict` function is used in flow sink.
38
38
*/
39
- class ZSTDDecompressUsingDictFunction extends DecompressionFunction {
40
- ZSTDDecompressUsingDictFunction ( ) { this .hasGlobalName ( [ "ZSTD_decompress_usingDDict" ] ) }
39
+ class ZstdDecompressUsingDdictFunction extends DecompressionFunction {
40
+ ZstdDecompressUsingDdictFunction ( ) { this .hasGlobalName ( [ "ZSTD_decompress_usingDDict" ] ) }
41
41
42
42
override int getArchiveParameterIndex ( ) { result = 3 }
43
43
}
44
44
45
45
/**
46
- * The `ZSTD_decompress_usingDDict ` function is used in flow sink .
46
+ * The `fopen_orDie ` function as a flow step .
47
47
*/
48
- class ZSTDDecompressUsingDDictFunction extends DecompressionFunction {
49
- ZSTDDecompressUsingDDictFunction ( ) { this .hasGlobalName ( [ "ZSTD_decompress_usingDDict" ] ) }
48
+ class FopenOrDieFunction extends DecompressionFlowStep {
49
+ FopenOrDieFunction ( ) { this .hasGlobalName ( "fopen_orDie" ) }
50
50
51
- override int getArchiveParameterIndex ( ) { result = 3 }
51
+ override predicate isAdditionalFlowStep ( DataFlow:: Node node1 , DataFlow:: Node node2 ) {
52
+ exists ( FunctionCall fc | fc .getTarget ( ) = this |
53
+ node1 .asIndirectExpr ( ) = fc .getArgument ( 0 ) and
54
+ node2 .asExpr ( ) = fc
55
+ )
56
+ }
57
+ }
58
+
59
+ /**
60
+ * The `fread_orDie` function as a flow step.
61
+ */
62
+ class FreadOrDieFunction extends DecompressionFlowStep {
63
+ FreadOrDieFunction ( ) { this .hasGlobalName ( "fread_orDie" ) }
64
+
65
+ override predicate isAdditionalFlowStep ( DataFlow:: Node node1 , DataFlow:: Node node2 ) {
66
+ exists ( FunctionCall fc | fc .getTarget ( ) = this |
67
+ node1 .asIndirectExpr ( ) = fc .getArgument ( 2 ) and
68
+ node2 .asIndirectExpr ( ) = fc .getArgument ( 0 )
69
+ )
70
+ }
52
71
}
0 commit comments