mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +00:00
virDomainAudioSDLParse: Use virXMLProp*
This strictens the parser to disallow negative values (interpreted as `UINT_MAX + value + 1`) for attribute `bufferCount`. `bufferCount` does not benefit from being referable as e.g. "-7" for requesting 4294967289 buffers, as this value is distinctly out of range for normal use. 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>
This commit is contained in:
parent
4fc365934a
commit
8b901da616
@ -13494,15 +13494,9 @@ static int
|
|||||||
virDomainAudioSDLParse(virDomainAudioIOSDL *def,
|
virDomainAudioSDLParse(virDomainAudioIOSDL *def,
|
||||||
xmlNodePtr node)
|
xmlNodePtr node)
|
||||||
{
|
{
|
||||||
g_autofree char *bufferCount = virXMLPropString(node, "bufferCount");
|
if (virXMLPropUInt(node, "bufferCount", 10, VIR_XML_PROP_NONE,
|
||||||
|
&def->bufferCount) < 0)
|
||||||
if (bufferCount &&
|
|
||||||
virStrToLong_ui(bufferCount, NULL, 10,
|
|
||||||
&def->bufferCount) < 0) {
|
|
||||||
virReportError(VIR_ERR_XML_ERROR,
|
|
||||||
_("cannot parse 'bufferCount' value '%s'"), bufferCount);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user