mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 22:25:25 +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,
|
||||
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