Skip to content

Commit 3f26c3f

Browse files
committed
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
1 parent 025c3ff commit 3f26c3f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

imap/jmap_ical.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7920,7 +7920,7 @@ static void calendarevent_to_ical(icalcomponent *comp,
79207920
}
79217921

79227922
jprop = json_object_get(event, "priority");
7923-
if (json_integer_value(jprop) >= 0 || json_integer_value(jprop) <= 9) {
7923+
if (json_is_integer(jprop)) {
79247924
remove_icalprop(comp, ICAL_PRIORITY_PROPERTY);
79257925
icalproperty *prop = icalproperty_new_priority(json_integer_value(jprop));
79267926
icalcomponent_add_property(comp, prop);

0 commit comments

Comments
 (0)