【发布时间】:2021-08-03 23:14:38
【问题描述】:
我有以下文件夹结构:
└── MyProj
├── Dangerous_Memcopy
│ ├── Config.qll
│ └── ...
├── MemMangementLibraries
│ ├── FFmpegMemory
│ └── ...
这是Config.qll的开头:
import cpp
import Utils
// Change here the memory library if wrappers exists in project
import MemMangementLibraries.FFmpegMemory
import semmle.code.cpp.dataflow.TaintTracking
class MyConfig extends TaintTracking::Configuration{
MyConfig() {this = "MyConfig"}
override predicate isSource(DataFlow::Node node){
exists(
CallAllocationExpr alloc_foo |
(
node.asExpr() = alloc_foo
and not alloc_foo.getFile().toString().matches("%mem.c%")
)
)
}
...
我在四行有错误:import MemMangementLibraries.FFmpegMemory:
无法解析模块 MemMangementLibraries.FFmpegMemory
我不明白为什么。我使用库名称后的文件夹名称进行了导入:
import MemMangementLibraries.FFmpegMemory
知道可能是什么问题吗?
如果我将库FFmpegMemory.qll 移动到文件夹Dangerous_Memcopy 下并将Config.qll 中的第四行更改为import FFmpegMemory,它将接受它。
它似乎无法识别导入时使用的文件夹MemMangementLibraries。
【问题讨论】: