Fixed buffer size check