diff options
author | 2022-09-26 13:50:14 +0000 | |
---|---|---|
committer | 2022-09-26 13:50:14 +0000 | |
commit | 07f428797d10af7dfd1719a6576e605c60cbd052 (patch) | |
tree | f8d6bf2fc6606cd4172e27148c2c2049acfbe8f5 /libfdt | |
parent | a319a6a35270f3554abe7050dd2ae2290e0533e0 (diff) | |
parent | ab87859fc200776f716b8511ad6417e1013feae1 (diff) |
libfdt: fdt_path_offset_namelen: Reject empty paths am: d10c84c4bc am: 9f4834b735 am: e0440b0907 am: 13d00fad64 am: 7799b9fb26 am: 98ab028002 am: 0a053dfe49 am: ab87859fc2
Original change: https://googleplex-android-review.googlesource.com/c/platform/external/dtc/+/20024811
Change-Id: Iee1eeed7bbca286bbba6f9c8b151df302554694f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'libfdt')
-rw-r--r-- | libfdt/fdt_ro.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libfdt/fdt_ro.c b/libfdt/fdt_ro.c index 362cc4a..a62ec78 100644 --- a/libfdt/fdt_ro.c +++ b/libfdt/fdt_ro.c @@ -266,6 +266,9 @@ int fdt_path_offset_namelen(const void *fdt, const char *path, int namelen) 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); |