From 85cc574d5071d945bb6174b4ffa5f30037592842 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Thu, 12 Apr 2018 15:15:33 -0700 Subject: [PATCH] Prevent throw in gnc-pricedb. If a price lookup is given an invalid time64/timespec (i.e. INT64_MAX) then just return NULL instead of trying to find the nearest price. --- libgnucash/engine/gnc-pricedb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libgnucash/engine/gnc-pricedb.c b/libgnucash/engine/gnc-pricedb.c index 186f697c55..62e31117b8 100644 --- a/libgnucash/engine/gnc-pricedb.c +++ b/libgnucash/engine/gnc-pricedb.c @@ -2348,6 +2348,7 @@ lookup_nearest_in_time(GNCPriceDB *db, GList *item = NULL; if (!db || !c || !currency) return NULL; + if (t.tv_sec == INT64_MAX) return NULL; ENTER ("db=%p commodity=%p currency=%p", db, c, currency); price_list = pricedb_get_prices_internal (db, c, currency, TRUE); if (!price_list) return NULL;