* commit '5d094c408841370e4a6f2846ae3408d2e6d12f94': Avoid segfaults if properties are not initialized
This commit is contained in:
commit
a015800e73
@ -325,6 +325,8 @@ static void *to_prop_obj(prop_off_t off)
|
|||||||
{
|
{
|
||||||
if (off > pa_data_size)
|
if (off > pa_data_size)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
if (!__system_property_area__)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
return __system_property_area__->data + off;
|
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;
|
const char *remaining_name = name;
|
||||||
|
|
||||||
|
if (!trie) return NULL;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
char *sep = strchr(remaining_name, '.');
|
char *sep = strchr(remaining_name, '.');
|
||||||
bool want_subtree = (sep != NULL);
|
bool want_subtree = (sep != NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user