[automerger skipped] Merge TP1A.221105.002 to aosp-master - DO NOT MERGE am: bca43fa152 -s ours

am skip reason: Merged-In I200e94ae7c45f0c474c449c3808766932f62d23f with SHA-1 9fb2d8a4f4 is already in history

Original change: https://android-review.googlesource.com/c/platform/external/dtc/+/2294418

Change-Id: Ib66741e72e32412c574d869c713649de4fc885f0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/libfdt/fdt_ro.c b/libfdt/fdt_ro.c
index 9f6c551..87d736b 100644
--- a/libfdt/fdt_ro.c
+++ b/libfdt/fdt_ro.c
@@ -255,6 +255,12 @@
 
 	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);