raw: move buffer size check up.