Make g_date_time_new check its arguments
authorMatthias Clasen <mclasen@redhat.com>
Sat, 17 Aug 2013 16:35:33 +0000 (12:35 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 17 Aug 2013 16:35:33 +0000 (12:35 -0400)
commit8b3d779d1ece535680724812fddffbdc940f328c
treed4c5d7d6cb8b12a4f4678624b5ef8f02b469fb10
parente70250bbd5e786240fee7ad373ee16657518acf7
Make g_date_time_new check its arguments

The documentation for this function explicitly gives valid
ranges for the arguments and states that out-of-range arguments
will cause NULL to be returned. Only, the code didn't check
the ranges, and crashed instead. Fix that and add a testcase
for invalid arguments. It turns out that the test_z testcase
was providing invalid arguments and relied on g_date_time_new
to return a non-NULL value anyway, so this commit fixes that
testcase as well.

https://bugzilla.gnome.org/show_bug.cgi?id=702674
glib/gdatetime.c
glib/tests/gdatetime.c