[libvirt PATCH] storage: logical: don't write past buffer bounds