@@ -15,11 +15,17 @@ import cpp
1515import semmle.code.cpp.ir.dataflow.TaintTracking
1616import semmle.code.cpp.security.FlowSources
1717
18+ /**
19+ * A Pointer Variable is used in Flow source
20+ */
21+ private class PointerVar extends VariableAccess {
22+ PointerVar ( ) { this .getType ( ) instanceof PointerType }
23+ }
1824/**
1925 * A unsigned char Variable is used in Flow source
2026 */
2127private class Uint8Var extends VariableAccess {
22- Uint8Var ( ) { this .getType ( ) .stripType ( ) .resolveTypedefs ( ) instanceof UnsignedCharType }
28+ Uint8Var ( ) { this .getType ( ) .stripType ( ) .resolveTypedefs * ( ) instanceof UnsignedCharType }
2329}
2430
2531/**
@@ -33,7 +39,7 @@ private class MzStreampVar extends VariableAccess {
3339 * A Char Variable is used in Flow source
3440 */
3541private class CharVar extends VariableAccess {
36- CharVar ( ) { this .getType ( ) .stripType ( ) instanceof CharType }
42+ CharVar ( ) { this .getType ( ) .stripType ( ) . resolveTypedefs * ( ) instanceof CharType }
3743}
3844
3945/**
@@ -71,7 +77,10 @@ private class MzZipReaderExtract extends Function {
7177 MzZipReaderExtract ( ) {
7278 this .hasGlobalName ( [
7379 "mz_zip_reader_extract_file_to_heap" , "mz_zip_reader_extract_to_heap" ,
74- "mz_zip_reader_extract_to_callback"
80+ "mz_zip_reader_extract_to_callback" , "mz_zip_reader_extract_file_to_callback" ,
81+ "mz_zip_reader_extract_to_mem" , "mz_zip_reader_extract_file_to_mem" ,
82+ "mz_zip_reader_extract_iter_read" , "mz_zip_reader_extract_to_file" ,
83+ "mz_zip_reader_extract_file_to_file"
7584 ] )
7685 }
7786}
@@ -111,6 +120,9 @@ module MinizTaintConfig implements DataFlow::StateConfigSig {
111120 source .asExpr ( ) instanceof Uint8Var and
112121 state = ""
113122 or
123+ source .asExpr ( ) instanceof PointerVar and
124+ state = ""
125+ or
114126 source .asExpr ( ) instanceof CharVar and
115127 state = ""
116128 or
0 commit comments