Fix segfault when sepolicy.rule has empty line

This commit is contained in:
LoveSy 2024-03-02 20:35:18 +08:00 committed by John Wu
parent 74af79ad03
commit 2290ddeb89

View File

@ -416,6 +416,7 @@ else if (strcmp(name, action) == 0) { \
#define add_action(act, type) add_action_func(#act, type, act)
void sepolicy::parse_statement(rust::Str stmt) {
if (stmt.empty()) return;
// strtok modify strings, create a copy
string cpy(stmt.data(), stmt.length());