After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 540012 - g_date_add_days should check for overflow
g_date_add_days should check for overflow
Status: RESOLVED DUPLICATE of bug 335731
Product: glib
Classification: Platform
Component: datetime
unspecified
Other All
: Normal minor
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2008-06-24 18:20 UTC by Morten Welinder
Modified: 2018-04-12 10:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add missing g_return_if_fail check in g_date_add_days (720 bytes, patch)
2008-08-24 00:23 UTC, Zbigniew Chyla
reviewed Details | Review

Description Morten Welinder 2008-06-24 18:20:58 UTC
g_date_add_days should check for overflow before it adds.  Otherwise
you can get a g_date_valid date that isn't valid.
Comment 1 Zbigniew Chyla 2008-08-24 00:23:45 UTC
Created attachment 117285 [details] [review]
Add missing g_return_if_fail check in g_date_add_days
Comment 2 Matthias Clasen 2008-08-27 21:51:23 UTC
note that julian_days is always 32 bit, so it may be better to use an explicit constant instead of G_MAXUINT.
Comment 3 Philip Withnall 2018-04-12 10:17:05 UTC
Duplicate of bug #335731.

*** This bug has been marked as a duplicate of bug 335731 ***