libfdt: fdt_path_offset_namelen: Reject empty paths am: d10c84c4bc am: 9f4834b735 am: e0440b0907 am: 13d00fad64 am: 7799b9fb26 am: 98ab028002 am: 0a053dfe49 am: 1716041baa

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

Change-Id: I37c1127c7b10f1152a5dbfe0155f7a4c36b9d5e5
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 e61df25..87d736b 100644
--- a/libfdt/fdt_ro.c
+++ b/libfdt/fdt_ro.c
@@ -258,6 +258,9 @@
 	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);