X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/b0d623f7f2ae71ed96e60569f61f9a9a27016e80..99c3a10404e5d1ef94397ab4df5a8b74711fc4d3:/pexpert/gen/device_tree.c diff --git a/pexpert/gen/device_tree.c b/pexpert/gen/device_tree.c index dc3ea9ddc..d78bed0bf 100644 --- a/pexpert/gen/device_tree.c +++ b/pexpert/gen/device_tree.c @@ -127,11 +127,18 @@ GetNextChild(RealDTEntry sibling) static const char * GetNextComponent(const char *cp, char *bp) { + size_t length = 0; + char *origbp = bp; + while (*cp != 0) { if (*cp == kDTPathNameSeparator) { cp++; break; } + if (++length > kDTMaxEntryNameLength) { + *origbp = '\0'; + return cp; + } *bp++ = *cp++; } *bp = 0;