From: Cole Robinson Date: Fri, 16 Jan 2009 16:50:11 +0000 (+0000) Subject: Fix segfault with console device back compat. X-Git-Tag: LIBVIRT_0_6_0~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46d4a5e0476c798ae349599ec5f72459f52ebcde;p=thirdparty%2Flibvirt.git Fix segfault with console device back compat. --- diff --git a/ChangeLog b/ChangeLog index d2f467b989..7655836d7b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Fri Jan 16 11:48:41 EST 2009 Cole Robinson + + * src/domain_conf.c: Fix segfault with console device back compat. + Thu Jan 15 20:12:19 GMT 2009 Daniel P. Berrange * src/remote_internal.c: Fix bug when fork isn't available (Win32) diff --git a/src/domain_conf.c b/src/domain_conf.c index 4250d81c76..94196e83f7 100644 --- a/src/domain_conf.c +++ b/src/domain_conf.c @@ -3328,8 +3328,9 @@ char *virDomainDefFormat(virConnectPtr conn, if (virDomainChrDefFormat(conn, &buf, def->console, "console") < 0) goto cleanup; } else if (def->nserials != 0) { - /* ..else for legacy compat duplicate the serial device as a console */ - if (virDomainChrDefFormat(conn, &buf, def->serials[n], "console") < 0) + /* ..else for legacy compat duplicate the first serial device as a + * console */ + if (virDomainChrDefFormat(conn, &buf, def->serials[0], "console") < 0) goto cleanup; }