if (audioNode) {
g_autofree char *tmp = NULL;
tmp = virXMLPropString(audioNode, "id");
+ if (!tmp) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("missing audio 'id' attribute"));
+ goto error;
+ }
if (virStrToLong_ui(tmp, NULL, 10, &def->audioId) < 0 ||
def->audioId == 0) {
virReportError(VIR_ERR_XML_ERROR,
ctxt->node = node;
type = virXMLPropString(node, "type");
+ if (!type) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("missing audio 'type' attribute"));
+ goto error;
+ }
+
if ((def->type = virDomainAudioTypeTypeFromString(type)) < 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("unknown audio type '%s'"), type);
}
tmp = virXMLPropString(node, "id");
+ if (!tmp) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("missing audio 'id' attribute"));
+ goto error;
+ }
if (virStrToLong_ui(tmp, NULL, 10, &def->id) < 0 ||
def->id == 0) {
virReportError(VIR_ERR_XML_ERROR,