Prevent integer overflow of months in exsltDateFormatDuration()

  • libexslt/date.c: (exsltDateFormatDuration):
  • Change months to 'unsigned long' type, and avoid negating LONG_MIN by assigning the value of LONG_MAX + 1UL instead.
  • Casting months to 'long' is okay since its value will be in the range [0-11] later.

Found by OSS-Fuzz #56488.

Merge request reports