[DO NOT MERGE] Check bounds in offsetToPtr
am: 7b83d625aa

Change-Id: Icfcec14e7d4bfcd6c893f0fa319541223b9d7901