We need to make sure that the chardev is TCP. Without this check we
may access different part of union and corrupt pointers.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
if (qemuDomainChrPreInsert(vmdef, chr) < 0)
goto cleanup;
- if (cfg->chardevTLS) {
+ if (dev->type == VIR_DOMAIN_CHR_TYPE_TCP &&
+ cfg->chardevTLS) {
if (qemuBuildTLSx509BackendProps(cfg->chardevTLSx509certdir,
dev->data.tcp.listen,
cfg->chardevTLSx509verify,
sa_assert(tmpChr->info.alias);
- if (cfg->chardevTLS &&
+ if (tmpChr->source.type == VIR_DOMAIN_CHR_TYPE_TCP &&
+ cfg->chardevTLS &&
!(objAlias = qemuAliasTLSObjFromChardevAlias(tmpChr->info.alias)))
goto cleanup;