llvm-project
cbf10bcb - [lld-macho] Avoid infinite recursion when parsing corrupted export tries (#152569)

Commit
171 days ago
[lld-macho] Avoid infinite recursion when parsing corrupted export tries (#152569) If an export trie is encoded incorrectly, and one of the children offsets points back to one of the nodes earlier in the serialization, the current code will end up in an infinite recursion, and eventually fail exhausting the available memory. The failure can be avoided if, before recursing, one checks that the offset is valid, that is, that the offset is beyond the current position. This is similar to a check done by llvm-objdump which reports the trie being corrupted.
Author
Parents
Loading