[DO NOT MERGE] Check bounds in offsetToPtr am: bb6096d37b  -s ours
am: 31b54b9803

Change-Id: Idfb4997bc0e44322bcf2db7e111b76ea59244168