[automerge] libfdt: fdt_path_offset_namelen: Reject empty paths 2p: a6ac6d916d
2p: c69e9730e6
am: 5b78ca8410
Original change: https://googleplex-android-review.googlesource.com/c/platform/external/dtc/+/20024810 Change-Id: I29a121003addfe5db9fd8d24a7f05eaa0403b06e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
a67a4aa8d0
1 changed files with 3 additions and 0 deletions
|
@ -255,6 +255,9 @@ int fdt_path_offset_namelen(const void *fdt, const char *path, int namelen)
|
|||
|
||||
FDT_RO_PROBE(fdt);
|
||||
|
||||
if (namelen < 1)
|
||||
return -FDT_ERR_BADPATH;
|
||||
|
||||
/* see if we have an alias */
|
||||
if (*path != '/') {
|
||||
const char *q = memchr(path, '/', end - p);
|
||||
|
|
Loading…
Reference in a new issue