Prevent undefined behavior in magiskboot

This commit is contained in:
topjohnwu
2021-05-10 18:38:30 -07:00
parent 6099f3b015
commit 7df23ceb74
7 changed files with 31 additions and 45 deletions

View File

@@ -31,7 +31,7 @@ public:
bool check_env(const char *name) {
const char *val = getenv(name);
return val ? val == "true"sv : false;
return val != nullptr && val == "true"sv;
}
void magisk_cpio::patch() {