diff --git a/VolumeManager.cpp b/VolumeManager.cpp index 13a943f..c3c95f6 100644 --- a/VolumeManager.cpp +++ b/VolumeManager.cpp @@ -37,6 +37,7 @@ #include #include +#include #include #include #include @@ -596,6 +597,10 @@ int VolumeManager::remountUid(uid_t uid, const std::string& mode) { // Poke through all running PIDs look for apps running as UID while ((de = readdir(dir))) { + pid_t pid; + if (de->d_type != DT_DIR) continue; + if (!android::base::ParseInt(de->d_name, &pid)) continue; + pidFd = -1; nsFd = -1;