================ @@ -53,8 +53,21 @@ template <typename A> class EHHeaderParser { template <typename A> bool EHHeaderParser<A>::decodeEHHdr(A &addressSpace, pint_t ehHdrStart, - pint_t ehHdrEnd, EHHeaderInfo &ehHdrInfo) { + size_t ehHdrSize, EHHeaderInfo &ehHdrInfo) { pint_t p = ehHdrStart; + pint_t ehHdrEnd = ehHdrStart + ehHdrSize; + + // Ensure that we don't read data beyond the end of .eh_frame_hdr + if (ehHdrSize < 4) { ---------------- compnerd wrote:
I kinda feel that its safer - its not changing the semantics of the parameter and can ensure that any downstream forks don't need to worry about the change in the internal call. https://github.com/llvm/llvm-project/pull/68815 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits