Prevent out-of-bounds read

Bug: 204077881
Test: See bug for PoC instructions.
Change-Id: Ie8d6792ff391d36d0e199a1d7f649e6081c1e8ac
Merged-In: Ie8d6792ff391d36d0e199a1d7f649e6081c1e8ac
(cherry picked from commit d55f55d2f8beffcfbdd3f2b66007ea6d4f851d73)
(cherry picked from commit cc538ed26803328445d52383f91025b357cda47d)
Merged-In:Ie8d6792ff391d36d0e199a1d7f649e6081c1e8ac
1 file changed