jstedfast / gmime

A C/C++ MIME creation and parser library with support for S/MIME, PGP, and Unix mbox spools.
GNU Lesser General Public License v2.1
115 stars 36 forks source link

Don’t call g_time_zone_new_offset() with offsets >24 hours #120

Closed pwithnall closed 2 years ago

pwithnall commented 2 years ago

This is part of https://gitlab.gnome.org/GNOME/glib/-/issues/2620, which in turn came from Debian bug https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1007226.

Calling g_time_zone_new_offset() with a large offset (>24h) will cause an assertion failure in GLib <2.72.0. There’s a fix for GLib 2.72.0, but older versions of GLib will still have this (or a different) assertion failure.

g_time_zone_new_offset() isn’t an ideal API, in that it has no way of reporting errors, and not all timezone offsets are valid. Currently there is no direct replacement.

You have several options, depending on what makes the most sense for how GMime handles timezones internally:

jstedfast commented 2 years ago

Thanks. I ended up using your g_time_zone_new_identifier() recommendation.

jstedfast commented 2 years ago

Can you let the person who originally filed the bug report that I will make a new release with the bug fix "soon" (next few days)? Thanks!

frozencemetery commented 2 years ago

It's me, and understood, thanks!

jstedfast commented 2 years ago

No prob!

jstedfast commented 2 years ago

Released: https://github.com/jstedfast/gmime/releases/tag/3.2.10

jstedfast commented 2 years ago

Fuuuuuuuuuuu... new base64 decoder was broken.

Releasing 3.2.11. Gah!

jstedfast commented 2 years ago

https://github.com/jstedfast/gmime/releases/tag/3.2.11