Change buffer check to avoid an unlikely pointer arithmetic overflow.