Skip to content

Fix isc_time_add() overflow

Ondřej Surý requested to merge ondrej/fix-isc_time_add-overflow-v9_16 into v9_16

The isc_time_add() could overflow when t.seconds + i.seconds == UINT_MAX and t.nanoseconds + i.nanoseconds >= NS_PER_S.

Fix the overflow in isc_time_add(), and simplify the ISC_R_RANGE checks both in isc_time_add() and isc_time_subtract() functions.

(cherry picked from commit 8c05f12b)

Merge request reports