Commit 72270825 authored by topjohnwu's avatar topjohnwu

Prevent segmentation fault when resetprop is unsupported

parent 1e94f0a0
......@@ -129,7 +129,7 @@ int prop_exist(const char *name) {
// Get prop by name, return string
string getprop(const char *name, bool persist) {
if (!check_legal_property_name(name) || init_resetprop())
return nullptr;
return string();
const prop_info *pi = __system_property_find(name);
if (pi == nullptr) {
if (persist && strncmp(name, "persist.", 8) == 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment