Null-terminate libselinux seinfo in fuzzer. am: f68a36b119

Original change: https://android-review.googlesource.com/c/platform/external/selinux/+/1509588

Change-Id: Ia0f2a8eb38659558c711bb28acba3c9da1aa753c
This commit is contained in:
Bram Bonné 2020-11-24 12:29:31 +00:00 committed by Automerger Merge Worker
commit 0281142093

View file

@ -26,9 +26,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
uid_t uid = fdp.ConsumeIntegral<int>();
bool isSystemServer = fdp.ConsumeBool();
std::string pkgname = fdp.ConsumeRandomLengthString();
std::vector<char> seinfo = fdp.ConsumeRemainingBytes<char>();
std::string seinfo = fdp.ConsumeRemainingBytesAsString();
selinux_android_setcontext(uid, isSystemServer, seinfo.data(), pkgname.c_str());
selinux_android_setcontext(uid, isSystemServer, seinfo.c_str(), pkgname.c_str());
return 0;
}