Skip to content

Commit

Permalink
Fix segfault when sepolicy.rule has empty line
Browse files Browse the repository at this point in the history
  • Loading branch information
yujincheng08 authored and topjohnwu committed Mar 2, 2024
1 parent 74af79a commit 2290dde
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions native/src/sepolicy/statement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down

0 comments on commit 2290dde

Please sign in to comment.