On 1/21/21 11:40 AM, Peter Krempa wrote:
virStrToLong_ul doesn't report it's own error.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1918674
Signed-off-by: Peter Krempa <[email protected]>


Reviewed-by: Laine Stump <[email protected]>

---
  src/conf/network_conf.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index 4f1115e103..ff7a56f4f4 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -418,8 +418,11 @@ 
virNetworkDHCPLeaseTimeDefParseXML(virNetworkDHCPLeaseTimeDefPtr *lease,
      if (!(expirystr = virXMLPropString(node, "expiry")))
          return 0;

-    if (virStrToLong_ul(expirystr, NULL, 10, &expiry) < 0)
+    if (virStrToLong_ul(expirystr, NULL, 10, &expiry) < 0) {
+        virReportError(VIR_ERR_XML_ERROR,
+                       _("failed to parse expiry value '%s'"), expirystr);
          return -1;
+    }

      if ((unitstr = virXMLPropString(node, "unit"))) {
          if ((unit = virNetworkDHCPLeaseTimeUnitTypeFromString(unitstr)) < 0) {


Reply via email to