Commit c0de3da7 authored by Sam Thursfield's avatar Sam Thursfield
Browse files

extract: Avoid creating invalid ISO date strings

Fixes #175
parent 4ac76bd5
Pipeline #290388 passed with stages
in 8 minutes and 46 seconds
......@@ -511,7 +511,7 @@ parse_month (const gchar *month)
* @date_string: the date in a string pointer
*
* This function uses a number of methods to try and guess the date
* held in @date_string. The @date_string must be at least 5
* held in @date_string. The @date_string must be at least 4
* characters in length or longer for any guessing to be attempted.
* Some of the string formats guessed include:
*
......@@ -555,6 +555,11 @@ tracker_date_guess (const gchar *date_string)
*/
if (len == 4) {
if (is_int (date_string)) {
if (atoi (date_string) == 0) {
/* Avoid producing an invalid ISO date '0000-01-01T00:00:00Z' */
return NULL;
}
buf[0] = date_string[0];
buf[1] = date_string[1];
buf[2] = date_string[2];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment