Merge "Avoid segfaults if properties are not initialized"
diff --git a/libc/bionic/system_properties.c b/libc/bionic/system_properties.c
index 4c2e5a2..fd56431 100644
--- a/libc/bionic/system_properties.c
+++ b/libc/bionic/system_properties.c
@@ -325,6 +325,8 @@
{
if (off > pa_data_size)
return NULL;
+ if (!__system_property_area__)
+ return NULL;
return __system_property_area__->data + off;
}
@@ -384,6 +386,8 @@
{
const char *remaining_name = name;
+ if (!trie) return NULL;
+
while (true) {
char *sep = strchr(remaining_name, '.');
bool want_subtree = (sep != NULL);