ports/138408: libofx import timestamp may wrong
Takanori Watanabe
takawata at init-main.com
Mon Aug 31 18:10:06 UTC 2009
>Number: 138408
>Category: ports
>Synopsis: libofx import timestamp may wrong
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Mon Aug 31 18:10:05 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator: Takanori Watanabe
>Release: 8.0-CURRENT
>Organization:
Private
>Environment:
FreeBSD sana.init-main.com 8.0-BETA2 FreeBSD 8.0-BETA2 #13 r195939M: Wed Jul 29 17:20:15 JST 2009 takawata at rin.init-main.com:/usr/obj/usr/src.svn/head/sys/LIEUTENANT i386
>Description:
Sometimes the date value read from ofx file entry sets to the Epoch - 1.
That is because not fully initialized struct tm is passed to mktime(3) and
wile structure may detected by the function and returns -1 value.
>How-To-Repeat:
Read a ofx file by ofxdump etc. Note that it is not always occur because it is caused by wild structure.
>Fix:
Replace patch-lib_ofx_utilities.cpp with following.
--- lib/ofx_utilities.old 2007-10-27 21:15:58.000000000 +0900
+++ lib/ofx_utilities.cpp 2009-09-01 02:32:26.000000000 +0900
@@ -16,6 +16,7 @@
* *
***************************************************************************/
#include <config.h>
+#include <locale.h>
#include <iostream>
#include <assert.h>
@@ -113,6 +114,9 @@
char time_zone_specified = false;
time_t temptime;
+
+ bzero(&time, sizeof(time));
+
std::time(&temptime);
local_offset = difftime(mktime(localtime(&temptime)), mktime(gmtime(&temptime)));
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list