aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-10-28 08:40:23 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-10-28 08:40:23 +0000
commit8b96b67ca61dc5cc7e23d94f5f0edc64cc50b3f6 (patch)
treef29df083681388501085cc17375322d8888d1bf6
parent21158ae3ee232a3a269a16b958b2ec214810bfab (diff)
parent21007bde51f0f050fa6ebaa9476346857b79e9e4 (diff)
downloaddtc-android13-mainline-networking-release.tar.gz
Change-Id: I720a5b4215756f48ff06b2cac10b586de76dc196
-rw-r--r--libfdt/fdt_ro.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libfdt/fdt_ro.c b/libfdt/fdt_ro.c
index e03570a..67fb218 100644
--- a/libfdt/fdt_ro.c
+++ b/libfdt/fdt_ro.c
@@ -253,6 +253,12 @@ int fdt_path_offset_namelen(const void *fdt, const char *path, int namelen)
FDT_RO_PROBE(fdt);
+ if (namelen < 1)
+ return -FDT_ERR_BADPATH;
+
+ if (namelen < 1)
+ return -FDT_ERR_BADPATH;
+
/* see if we have an alias */
if (*path != '/') {
const char *q = memchr(path, '/', end - p);