From nobody@FreeBSD.org  Mon Aug 31 18:06:20 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A22D6106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 31 Aug 2009 18:06:20 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 910A68FC14
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 31 Aug 2009 18:06:20 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n7VI6J2f070749
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 31 Aug 2009 18:06:19 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n7VI6JPW070748;
	Mon, 31 Aug 2009 18:06:19 GMT
	(envelope-from nobody)
Message-Id: <200908311806.n7VI6JPW070748@www.freebsd.org>
Date: Mon, 31 Aug 2009 18:06:19 GMT
From: Takanori Watanabe <takawata@init-main.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: libofx import timestamp may wrong 
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         138408
>Category:       ports
>Synopsis:       [patch] finance/libofx import timestamp may be wrong
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 31 18:10:05 UTC 2009
>Closed-Date:    Sun Nov 08 00:07:49 UTC 2009
>Last-Modified:  Sun Nov  8 00:10:01 UTC 2009
>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@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:
State-Changed-From-To: open->closed 
State-Changed-By: arved 
State-Changed-When: Sun Nov 8 00:07:41 UTC 2009 
State-Changed-Why:  
committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=138408 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/138408: commit references a PR
Date: Sun,  8 Nov 2009 00:07:06 +0000 (UTC)

 arved       2009-11-08 00:06:57 UTC
 
   FreeBSD ports repository
 
   Modified files:
     finance/libofx       Makefile 
     finance/libofx/files patch-lib_ofx_utilities.cpp 
   Log:
   Fix an initialization bug
   Bump PORTREVISION
   
   PR:             138408
   Submitted by:   takawata
   
   Revision  Changes    Path
   1.27      +1 -1      ports/finance/libofx/Makefile
   1.2       +20 -13    ports/finance/libofx/files/patch-lib_ofx_utilities.cpp
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
