mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
network: NULL check for "modify" DNS-txt records
The "modify" command allowed to replace an existing record, now checks for the NULL string in the new value and throw error if found. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/655 Signed-off-by: Adam Julis <ajulis@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
0caacf47d7
commit
959ecee474
@ -3385,6 +3385,13 @@ virNetworkDefUpdateDNSTxt(virNetworkDef *def,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!txt.value) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
_("missing value of modifying DNS TXT record in network %1$s"),
|
||||
def->name);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
VIR_FREE(dns->txts[foundIdx].value);
|
||||
dns->txts[foundIdx].value = g_steal_pointer(&txt.value);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user