avoid overflow with large buffer sizes and/or offsets (closes #21831)
3 files changed