Skip to content

Commit 786e906

Browse files
fix directory traversal
1 parent 808d7f3 commit 786e906

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/swift-stdlib-tool/swift-stdlib-tool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ void enumerateDirectory(std::string directory, F&& func) {
888888
func(path);
889889
} else if (entry->d_type == DT_DIR) {
890890
// check if . or ..
891-
if (strncmp(entry->d_name, "..", entry->d_namlen)) {
891+
if (strncmp(entry->d_name, "..", entry->d_namlen) == 0) {
892892
continue;
893893
}
894894
enumerateDirectory(path, func);

0 commit comments

Comments
 (0)