Skip to content

[Bug] scan_directory_recursive 未限制递归深度可能导致栈溢出 #367

@TrueNine

Description

@TrueNine

Bug Description

scan_directory_recursive 对深层嵌套目录进行无条件递归,如果目录结构极深(如符号链接循环或恶意构造),会导致栈溢出。

所在文件

sdk/src/repositories/project_prompt.rs 第 137-178 行

建议修复

增加最大递归深度限制,或使用迭代式的 BFS/栈结构替代递归。

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglowLow priorityrustRust SDK/CLI/MCP code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions