[GWP-ASan] Only pack frames that are stored.
Backtrace() returns the number of frames that are *available*, rather
than the number of frames stored. When we pack, we supply the number of
frames we have stored. The number of available frames can exceed the
number of stored frames, leading to stack OOB read.
Fix up this problem.
Reviewed By: eugenis
Subscribers: #sanitizers, morehouse, cferris, pcc
Differential Revision: https://reviews.llvm.org/D76722
2 files changed