]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virDomainSoundDefParseXML: Use virXMLProp*
authorTim Wiederhake <twiederh@redhat.com>
Tue, 27 Apr 2021 11:12:53 +0000 (13:12 +0200)
committerJán Tomko <jtomko@redhat.com>
Mon, 3 May 2021 09:17:40 +0000 (11:17 +0200)
commit47896e0ba231eb2a50a86f7a6bfadd38110f5ed1
tree46b59dde8bc6a551cc58b8572f8c029c7377ce8b
parent241c22a9a531cb39d2b6b892561fe856f32f310d
virDomainSoundDefParseXML: Use virXMLProp*

This strictens the parser to disallow negative values (interpreted as
`UINT_MAX + value + 1`) for attribute `id`.

`id` must be greater than 0 and does not benefit from being referable as
e.g. "-7" for host audio backend 4294967289, as this value is distinctly
out of range for normal use.

Additionally, this patch fixes a use of NULL string with printf's %s
modifier if the `model` attribute is absent.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
src/conf/domain_conf.c