diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c index ceb1c1a958..83737a2c6f 100644 --- a/src/util/virsystemd.c +++ b/src/util/virsystemd.c @@ -135,6 +135,8 @@ virSystemdAppendValidMachineName(virBufferPtr buf, bool skip_dot = false; for (; *name; name++) { + if (virBufferError(buf)) + break; if (strlen(virBufferCurrentContent(buf)) >= 64) break;