Commit 49abfcaf authored by LoveSy's avatar LoveSy Committed by topjohnwu

Fix nullptr dereference when env abnormal

parent 50710c72
...@@ -574,6 +574,7 @@ void magic_mount() { ...@@ -574,6 +574,7 @@ void magic_mount() {
char buf[4096]; char buf[4096];
LOGI("* Loading modules\n"); LOGI("* Loading modules\n");
if (modules) {
for (const auto &m : *modules) { for (const auto &m : *modules) {
const char *module = m.name.data(); const char *module = m.name.data();
char *b = buf + sprintf(buf, "%s/" MODULEMNT "/%s/", MAGISKTMP.data(), module); char *b = buf + sprintf(buf, "%s/" MODULEMNT "/%s/", MAGISKTMP.data(), module);
...@@ -601,7 +602,7 @@ void magic_mount() { ...@@ -601,7 +602,7 @@ void magic_mount() {
system->collect_files(module, fd); system->collect_files(module, fd);
close(fd); close(fd);
} }
}
if (MAGISKTMP != "/sbin") { if (MAGISKTMP != "/sbin") {
// Need to inject our binaries into /system/bin // Need to inject our binaries into /system/bin
inject_magisk_bins(system); inject_magisk_bins(system);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment