libufdt: tests: Check input file integrity before parsing.

This prevents malformed input causing the tests to crash, misbehave or fail if there is not enough memory to contain them.

Ignore-AOSP-First: Security
Bug: 260569699
Test: mma system/libufdt
Test: system/libufdt/tests/run_tests.sh
Test: system/libufdt/tests/run_performance_test.sh
Change-Id: I89df0d33b5f6b5b9484a9b79534ab5163d184e3f
(cherry picked from commit 0750fc213182630aa6a4b2156a8beab8a75495c8)
3 files changed