Commit 6f532711 authored by Albert Astals Cid's avatar Albert Astals Cid Committed by Albert Astals Cid

glib: Fix cast from 'GTime *' (aka 'int *') to 'time_t *' (aka 'long *')

Sounds rather scary since we're storing a bigger value than what really
fits.

Fixed by the suggestion of https://developer.gnome.org/glib/stable/glib-Date-and-Time-Functions.html#GTime

Changing the type of _PopplerAttachment ctime/mtime would change the
structure size, thus break the BC, so leaving that for the future for
now
parent f2493d53
......@@ -111,9 +111,17 @@ _poppler_attachment_new (FileSpec *emb_file)
attachment->size = embFile->size ();
if (embFile->createDate ())
_poppler_convert_pdf_date_to_gtime (embFile->createDate (), (time_t *)&attachment->ctime);
{
time_t aux;
_poppler_convert_pdf_date_to_gtime (embFile->createDate (), &aux);
attachment->ctime = (GTime)aux; // FIXME This will overflow on dates from after 2038
}
if (embFile->modDate ())
_poppler_convert_pdf_date_to_gtime (embFile->modDate (), (time_t *)&attachment->mtime);
{
time_t aux;
_poppler_convert_pdf_date_to_gtime (embFile->modDate (), &aux);
attachment->mtime = (GTime)aux; // FIXME This will overflow on dates from after 2038
}
if (embFile->checksum () && embFile->checksum ()->getLength () > 0)
attachment->checksum = g_string_new_len (embFile->checksum ()->c_str (),
......
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