mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
SerialHelper: Check error_code to prevent infinite loop. (#725)
This commit is contained in:
@@ -219,6 +219,7 @@ void SerialHelper::QueryHubPaths(int32_t* status) {
|
||||
for (auto p = llvm::sys::fs::recursive_directory_iterator(
|
||||
"/sys/devices/soc0", ec);
|
||||
p != llvm::sys::fs::recursive_directory_iterator(); p.increment(ec)) {
|
||||
if (ec) break;
|
||||
llvm::StringRef path{p->path()};
|
||||
if (path.find("amba") == llvm::StringRef::npos) continue;
|
||||
if (path.find("usb") == llvm::StringRef::npos) continue;
|
||||
|
||||
Reference in New Issue
Block a user