diff --git a/native/src/sepolicy/api.cpp b/native/src/sepolicy/api.cpp index b23c0c460..a25dae883 100644 --- a/native/src/sepolicy/api.cpp +++ b/native/src/sepolicy/api.cpp @@ -55,14 +55,10 @@ static inline void expand(F &&f, T &&...args) { template static inline void expand(const Str &s, T &&...args) { - char buf[64]; - if (s.length() >= sizeof(buf)) return; if (s.empty()) { expand(std::forward(args)..., (char *) nullptr); } else { - memcpy(buf, s.data(), s.length()); - buf[s.length()] = '\0'; - expand(std::forward(args)..., buf); + expand(std::forward(args)..., std::string(s).data()); } }