From 2b759b84b083abe11bccf19cca65b2827996531e Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Mon, 9 Nov 2020 21:17:21 -0800 Subject: [PATCH] Properly reset string --- native/jni/magiskhide/proc_monitor.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/native/jni/magiskhide/proc_monitor.cpp b/native/jni/magiskhide/proc_monitor.cpp index 72ee8dbb2..ecffd6f0e 100644 --- a/native/jni/magiskhide/proc_monitor.cpp +++ b/native/jni/magiskhide/proc_monitor.cpp @@ -90,6 +90,7 @@ void update_uid_map() { size_t len = data_path.length(); auto dir = open_dir(APP_DATA_DIR); for (dirent *entry; (entry = xreaddir(dir.get()));) { + data_path.resize(len); data_path += '/'; data_path += entry->d_name; data_path += '/'; @@ -102,8 +103,6 @@ void update_uid_map() { continue; uid_proc_map[st.st_uid].emplace_back(hide.second); } - // Reset string - data_path.resize(len); } }