Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b0f1be0 authored by Adam Lesinski's avatar Adam Lesinski
Browse files

AAPT: Fix printing of resource configurations

Print out proper, copied configuration. We add fields to ResTable_config
and if we don't copy and fill in defaults when reading old configurations,
we end up with garbage values. This can potentially cause a crash as well.

Bug:22773426
Change-Id: I64f5ebe73ee72453bcdad3a19e48f8e7ad58e9c2
parent 71bfb270
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -6758,7 +6758,13 @@ void ResTable::print(bool inclValues) const
                    printf("      NON-INTEGER ResTable_type ADDRESS: %p\n", type);
                    continue;
                }
                String8 configStr = type->config.toString();

                // Always copy the config, as fields get added and we need to
                // set the defaults.
                ResTable_config thisConfig;
                thisConfig.copyFromDtoH(type->config);

                String8 configStr = thisConfig.toString();
                printf("      config %s:\n", configStr.size() > 0
                        ? configStr.string() : "(default)");
                size_t entryCount = dtohl(type->entryCount);