Fix unsigned int overflow

This commit is contained in:
Jens Eggerstedt 2019-05-21 11:21:29 +00:00 committed by Nick Wellnhofer
parent 0df3c2c9aa
commit b3a95d57f2

View File

@ -3877,7 +3877,7 @@ _xmlSchemaDateAdd (xmlSchemaValPtr dt, xmlSchemaValPtr dur)
temp = r->mon + carry;
r->mon = (unsigned int) MODULO_RANGE(temp, 1, 13);
r->year = r->year + (unsigned int) FQUOTIENT_RANGE(temp, 1, 13);
r->year = r->year + (long) FQUOTIENT_RANGE(temp, 1, 13);
if (r->year == 0) {
if (temp < 1)
r->year--;