fix out of range offsets to avoid invalid history exports GitOrigin-RevId: d00e3e9e08feb6c3be671b5805102a66782b3f92