mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-15 22:01:27 +00:00
datetime: Sanity check year, month and day when parsing ISO-8601 strings
Passing years > 9999, months > 12 or days > 31 to gst_date_time_new() will cause an assertion and generally does not make much sense. Instead consider it as a parsing error like hours > 24 and return NULL.
This commit is contained in:
parent
ab3362f13d
commit
95d6141112
1 changed files with 1 additions and 1 deletions
|
@ -799,7 +799,7 @@ gst_date_time_new_from_iso8601_string (const gchar * string)
|
|||
month = day = -1;
|
||||
}
|
||||
|
||||
if (ret >= 1 && year <= 0)
|
||||
if (ret >= 1 && (year <= 0 || year > 9999 || month > 12 || day > 31))
|
||||
return NULL;
|
||||
|
||||
else if (ret >= 1 && len < 16)
|
||||
|
|
Loading…
Reference in a new issue