================
@@ -1819,23 +1821,35 @@ llvm::Error 
AppleObjCRuntimeV2::SharedCacheImageHeaders::UpdateIfNeeded() {
   constexpr lldb::addr_t metadata_size =
       sizeof(uint32_t) + sizeof(uint32_t); // count + entsize
 
-  Status error;
+  /// Sanity check: m_count and m_entsize are external input, guard against
+  /// invalid values using an arbitrary 1GB maximum size.
+  const size_t memory_needed = static_cast<size_t>(m_count) * m_entsize;
----------------
felipepiovezan wrote:

I'm not even concerned about overflow to be honest. If the end result is 
something like 1TB without overflowing, I don't want to read it either.

https://github.com/llvm/llvm-project/pull/211774
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to