summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/MachOObjectFile.cpp
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2017-07-24 20:33:41 +0000
committerKevin Enderby <enderby@apple.com>2017-07-24 20:33:41 +0000
commit8100cdeddfbbbc79dabff9919c4f8414444e2f5d (patch)
tree2dd9b7d77398e75dc48acd69bb6c899c68d68c87 /llvm/lib/Object/MachOObjectFile.cpp
parentb739cb42f5c0a51bbd8faee6ebe2de76910485d9 (diff)
downloadbcm5719-llvm-8100cdeddfbbbc79dabff9919c4f8414444e2f5d.tar.gz
bcm5719-llvm-8100cdeddfbbbc79dabff9919c4f8414444e2f5d.zip
Small tweak to one check in error handling to the dyld compact export
entries in libObject (done in r308690). In the case when the last node has no children setting State.Current = Children + 1; where that would be past Trie.end() is actually ok since the pointer is not used with zero children. rdar://33490512 llvm-svn: 308924
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r--llvm/lib/Object/MachOObjectFile.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index 8b85049ea63..579faf607c0 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/lib/Object/MachOObjectFile.cpp
@@ -2789,13 +2789,13 @@ void ExportEntry::pushNode(uint64_t offset) {
return;
}
}
- if (Children + 1 >= Trie.end()) {
+ State.ChildCount = *Children;
+ if (State.ChildCount != 0 && Children + 1 >= Trie.end()) {
*E = malformedError("byte for count of childern in export trie data at "
"node: 0x" + utohexstr(offset) + " extends past end of trie data");
moveToEnd();
return;
}
- State.ChildCount = *Children;
State.Current = Children + 1;
State.NextChildIndex = 0;
State.ParentStringLength = CumulativeString.size();
OpenPOWER on IntegriCloud