mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-15 00:55:17 +00:00
Don't check validity of missing attributes in DNS SRV XML
This fixes a crash if one of them is missing. https://bugzilla.redhat.com/show_bug.cgi?id=988718
This commit is contained in:
parent
c4e23388e6
commit
461fd86a66
@ -920,7 +920,7 @@ virNetworkDNSSrvDefParseXML(const char *networkName,
|
|||||||
" of network %s"), networkName);
|
" of network %s"), networkName);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if (strlen(def->service) > DNS_RECORD_LENGTH_SRV) {
|
if (def->service && strlen(def->service) > DNS_RECORD_LENGTH_SRV) {
|
||||||
virReportError(VIR_ERR_XML_DETAIL,
|
virReportError(VIR_ERR_XML_DETAIL,
|
||||||
_("Service name '%s' in network %s is too long, limit is %d bytes"),
|
_("Service name '%s' in network %s is too long, limit is %d bytes"),
|
||||||
def->service, networkName, DNS_RECORD_LENGTH_SRV);
|
def->service, networkName, DNS_RECORD_LENGTH_SRV);
|
||||||
@ -936,7 +936,8 @@ virNetworkDNSSrvDefParseXML(const char *networkName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check whether protocol value is the supported one */
|
/* Check whether protocol value is the supported one */
|
||||||
if (STRNEQ(def->protocol, "tcp") && (STRNEQ(def->protocol, "udp"))) {
|
if (def->protocol && STRNEQ(def->protocol, "tcp") &&
|
||||||
|
(STRNEQ(def->protocol, "udp"))) {
|
||||||
virReportError(VIR_ERR_XML_DETAIL,
|
virReportError(VIR_ERR_XML_DETAIL,
|
||||||
_("Invalid protocol attribute value '%s' "
|
_("Invalid protocol attribute value '%s' "
|
||||||
" in DNS SRV record of network %s"),
|
" in DNS SRV record of network %s"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user