setprop: check if not setprop value but setprop name starts with "ro."

When setting property with setprop, a property name which starts with
"ro." could be set no matter how long the value name is.

Change-Id: Ia035ef009952db08ae8a6d4a2b8b9567d86124fc
This commit is contained in:
sanga1.lee 2024-04-22 15:45:46 +09:00 committed by Sanga Lee
parent f0db2406f7
commit 2c6b83f4d2

View file

@ -58,7 +58,7 @@ extern "C" int setprop_main(int argc, char** argv) {
}
}
if (value.size() >= PROP_VALUE_MAX && !StartsWith(value, "ro.")) {
if (value.size() >= PROP_VALUE_MAX && !StartsWith(name, "ro.")) {
std::cerr << "Value '" << value << "' is too long, " << value.size()
<< " bytes vs a max of " << PROP_VALUE_MAX << std::endl;
return EXIT_FAILURE;