From 3f26c3f669ed20e65a3ed0af30ac7ea6e23baccb Mon Sep 17 00:00:00 2001 From: Robert Stepanek Date: Wed, 22 Jan 2025 08:45:46 +0100 Subject: [PATCH] jmap_ical.c: reject non-integer priority value The conditional that validates the priority property value to be in the valid range from 0..9 had an error, effectively accepting any JSON value as a valid priority value. Any non-integer JSON value resulted in priority 0 to be set. This patch keeps accepting any JSON integer value as priority (contrary to RFC8984 requiring it to be in the 0..9 range), but now rejects any non-integer JSON value. Fixes #5226 --- imap/jmap_ical.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imap/jmap_ical.c b/imap/jmap_ical.c index 6a74768b81..0ae0b91d2a 100644 --- a/imap/jmap_ical.c +++ b/imap/jmap_ical.c @@ -7920,7 +7920,7 @@ static void calendarevent_to_ical(icalcomponent *comp, } jprop = json_object_get(event, "priority"); - if (json_integer_value(jprop) >= 0 || json_integer_value(jprop) <= 9) { + if (json_is_integer(jprop)) { remove_icalprop(comp, ICAL_PRIORITY_PROPERTY); icalproperty *prop = icalproperty_new_priority(json_integer_value(jprop)); icalcomponent_add_property(comp, prop);