File pacemaker#3517-0002-Low-libcrmcommon-reject-ISO-8601-duration-without-an.patch of Package pacemaker.38495
From 0f5500b7426547ba019a79e45e6ea8d47469ad8d Mon Sep 17 00:00:00 2001
From: Ken Gaillot <kgaillot@redhat.com>
Date: Tue, 4 Jun 2024 12:16:26 -0500
Subject: [PATCH] Low: libcrmcommon: reject ISO 8601 duration without any
values
Setting duration TRUE before checking for legal values meant that the
crm_time_is_defined() check near the end would always be true.
---
lib/common/iso8601.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/common/iso8601.c b/lib/common/iso8601.c
index 32ea911721..cf29bfe386 100644
--- a/lib/common/iso8601.c
+++ b/lib/common/iso8601.c
@@ -1104,7 +1104,6 @@ crm_time_parse_duration(const char *period_s)
}
diff = crm_time_new_undefined();
- diff->duration = TRUE;
for (const char *current = period_s + 1;
current[0] && (current[0] != '/') && !isspace(current[0]);
@@ -1214,6 +1213,8 @@ crm_time_parse_duration(const char *period_s)
"because no amounts and units given", period_s);
goto invalid;
}
+
+ diff->duration = TRUE;
return diff;
invalid:
--
2.35.3