Forward Port: Protect mk_buffer_cat() from invalid length