]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_calendar: Prevent assertion if event ends in past.
authorNaveen Albert <asterisk@phreaknet.org>
Wed, 23 Mar 2022 11:05:28 +0000 (11:05 +0000)
committerKevin Harwell <kharwell@digium.com>
Mon, 6 Jun 2022 21:55:25 +0000 (16:55 -0500)
commit3b7bcbb6d5d9c6d919964e4e3150de353c70111e
tree18cfe7816d3cbe9afae56adc99bc38d8ea9f03a6
parent8ec9e58eb4100c8212cfdb833c88701afbe5b8cd
res_calendar: Prevent assertion if event ends in past.

res_calendar will trigger an assertion currently
if the ending time is calculated to be in the past.
Unlike the reminder and start times, however, there
is currently no check to catch non-positive times
and set them to 1. As a result, if we get a negative
value by happenstance, this can cause a crash.

To prevent the assertion from begin triggered, we now
use the same logic as the reminder and start events
to catch this issue before it can cause a problem.

ASTERISK-29981 #close

Change-Id: Idfb3204d195f350d2575fb4bc72a54a597d6e93c
res/res_calendar.c