am df7436e7: Merge "Avoid segfaults if properties are not initialized"

* commit 'df7436e709035fb6f5667980042848c8b4ca3e79':
  Avoid segfaults if properties are not initialized
This commit is contained in:
Elliott Hughes 2013-09-03 14:09:08 -07:00 committed by Android Git Automerger
commit 5d094c4088

View File

@ -325,6 +325,8 @@ static void *to_prop_obj(prop_off_t off)
{
if (off > pa_data_size)
return NULL;
if (!__system_property_area__)
return NULL;
return __system_property_area__->data + off;
}
@ -384,6 +386,8 @@ static const prop_info *find_property(prop_bt *trie, const char *name,
{
const char *remaining_name = name;
if (!trie) return NULL;
while (true) {
char *sep = strchr(remaining_name, '.');
bool want_subtree = (sep != NULL);