Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Aug 2009 18:26:19 GMT
From:      Takanori Watanabe <takawata@init-main.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/138410: gnucash quote price editor adds price data as wrong date.
Message-ID:  <200908311826.n7VIQJAb093057@www.freebsd.org>
Resent-Message-ID: <200908311830.n7VIU8op016376@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         138410
>Category:       ports
>Synopsis:       gnucash quote price editor adds price data as wrong date.
>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:30:08 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Takanori Watanabe
>Release:        FreeBSD 8.0-BETA2
>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:
gnucash quote price editor consume date string and convert the string by strptime(3) then get time_t by mktime(3). And struct tm,  a mktime argument
is not initialized and mktime detects insane structure and returns -1. So the entry is always added as epoch -1 date.
>How-To-Repeat:
Use Price Editor and try to get quotes of your portfolio. Note that it is not always occur because it is caued by wild structure.

>Fix:
Add following patch as
files/patch-src-app-utils-guile-util.c 
And rebuild.

--- src/app-utils/guile-util.c.old      2008-01-08 10:06:47.000000000 +0900
+++ src/app-utils/guile-util.c  2009-09-01 03:04:30.000000000 +0900
@@ -1304,6 +1304,8 @@
 
   g_return_val_if_fail(s && format, -1);
 
+  bzero(&tm, sizeof(tm));
+
   if (!strptime(s, format, &tm))
     return -1;
 


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908311826.n7VIQJAb093057>