mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-08-20 08:57:33 +00:00
Fix segfault when sepolicy.rule has empty line
This commit is contained in:
@@ -416,6 +416,7 @@ else if (strcmp(name, action) == 0) { \
|
|||||||
#define add_action(act, type) add_action_func(#act, type, act)
|
#define add_action(act, type) add_action_func(#act, type, act)
|
||||||
|
|
||||||
void sepolicy::parse_statement(rust::Str stmt) {
|
void sepolicy::parse_statement(rust::Str stmt) {
|
||||||
|
if (stmt.empty()) return;
|
||||||
// strtok modify strings, create a copy
|
// strtok modify strings, create a copy
|
||||||
string cpy(stmt.data(), stmt.length());
|
string cpy(stmt.data(), stmt.length());
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user