mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 09:53:10 +00:00
virDomainAudioCoreAudioParse: Use virXMLProp*
This strictens the parser to disallow negative values (interpreted as `UINT_MAX + value + 1`) for attribute `bufferCount`. Allowing negative numbers to be interpreted this way makes no sense for this attribute. Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
parent
7423635e46
commit
23e763eb46
@ -13046,15 +13046,9 @@ static int
|
||||
virDomainAudioCoreAudioParse(virDomainAudioIOCoreAudio *def,
|
||||
xmlNodePtr node)
|
||||
{
|
||||
g_autofree char *bufferCount = virXMLPropString(node, "bufferCount");
|
||||
|
||||
if (bufferCount &&
|
||||
virStrToLong_ui(bufferCount, NULL, 10,
|
||||
&def->bufferCount) < 0) {
|
||||
virReportError(VIR_ERR_XML_ERROR,
|
||||
_("cannot parse 'bufferCount' value '%s'"), bufferCount);
|
||||
if (virXMLPropUInt(node, "bufferCount", 10, VIR_XML_PROP_NONE,
|
||||
&def->bufferCount) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user