IIUC these are only problematic when the test fails *and* when the failure leaves the buffer unchanged. Both of which are unlikely and not supposed to happen.
Imo having to use the sized version is annoying, and the asan warning arguably a false positive (it's theoretically possible, but not a problem in practice). Another, les intrusive option would be to zero initialize the buffers, or always add a 0 at the end instead.