summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Alburquerque <jaalburqu@svn.gnome.org>2009-06-22 13:23:17 -0400
committerJosé Alburquerque <jaalburqu@svn.gnome.org>2009-06-22 13:23:17 -0400
commit44b8b2812aaaa51b0b18555123aca5c0224a5e30 (patch)
treec1cda109375f9f65169f339797d0dddbc3ca71d4
parentb279b472c2221011c6420652d5a5122efa66f4bd (diff)
downloadglibmm-2-18.tar.gz
Check for invalid date in Glib::Date copy constructor.glibmm-2-18
-rw-r--r--ChangeLog5
-rw-r--r--glib/src/date.ccg5
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 92321238..1c40a03e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-06-22 José Alburquerque <jaalburqu@svn.gnome.org>
+
+ * glib/src/date.ccg: Check for an invalid date in copy constructor and
+ assignment operator. Fixes bug #585027.
+
2009-06-19 Murray Cumming <murrayc@murrayc.com>
Allow dynamic GType registration, using g_type_module_register_type().
diff --git a/glib/src/date.ccg b/glib/src/date.ccg
index fe09b501..620d0034 100644
--- a/glib/src/date.ccg
+++ b/glib/src/date.ccg
@@ -59,12 +59,13 @@ Date::Date(const GDate& castitem)
Date::Date(const Date& other)
{
g_date_clear(&gobject_, 1);
- g_date_set_julian(&gobject_, other.get_julian());
+ if (g_date_valid(&other.gobject_))
+ g_date_set_julian(&gobject_, other.get_julian());
}
Date& Date::operator=(const Date& other)
{
- if (&other != this)
+ if (&other != this && g_date_valid(&other.gobject_))
g_date_set_julian(&gobject_, other.get_julian());
return *this;