Merge Android 13 QPR1

Bug: 261731544
Merged-In: I14ab0a074ab994c1f598243d2d5795d2cd9a853a
Change-Id: I26650c5f0a4d98796dd1a9a8709ba704350b5492
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);