pw_i2c: Fix invalid copy Add error checking for copying expected rx data to rx buffer in MockInitiator to prevent potential seg faults. Testing: Create a failed expectation case for reading data. See the assert instead of seg fault. Change-Id: I856534b15ecc7f1971af034535264be0f1615fca Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/49481 Reviewed-by: Ewout van Bekkum <ewout@google.com> Commit-Queue: Kevin Zeng <zengk@google.com>
See our website: http://pigweed.dev