Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 884573

Summary: app-office/gnucash-4.8: io-gncxml-v2.cpp:1604:33: error: pointer may be used after ‘int fclose(FILE*)’ [-Werror=use-after-free]
Product: Gentoo Linux Reporter: Erik <esigra>
Component: Current packagesAssignee: Aaron W. Swenson <titanofold>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gnucash.org/show_bug.cgi?id=798458
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 882147    
Bug Blocks: 839906    
Attachments: /var/tmp/portage/app-office/gnucash-4.8/temp/build.log

Description Erik 2022-12-06 11:54:33 UTC
In function ‘gboolean wait_for_gzip(FILE*)’,
    inlined from ‘gboolean gnc_book_write_to_xml_file_v2(QofBook*, const char*, gboolean)’ at /var/tmp/portage/app-office/gnucash-4.8/work/gnucash-4.8/libgnucash/backend/xml/io-gncxml-v2.cpp:1635:28:
/var/tmp/portage/app-office/gnucash-4.8/work/gnucash-4.8/libgnucash/backend/xml/io-gncxml-v2.cpp:1604:33: error: pointer may be used after ‘int fclose(FILE*)’ [-Werror=use-after-free]
 1604 |             g_hash_table_remove (threads, file);
      |             ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
/var/tmp/portage/app-office/gnucash-4.8/work/gnucash-4.8/libgnucash/backend/xml/io-gncxml-v2.cpp: In function ‘gboolean gnc_book_write_to_xml_file_v2(QofBook*, const char*, gboolean)’:
/var/tmp/portage/app-office/gnucash-4.8/work/gnucash-4.8/libgnucash/backend/xml/io-gncxml-v2.cpp:1630:23: note: call to ‘int fclose(FILE*)’ here
 1630 |     if (out && fclose (out))
      |                ~~~~~~~^~~~~

Reproducible: Always
Comment 1 Erik 2022-12-06 12:00:53 UTC
Created attachment 840427 [details]
/var/tmp/portage/app-office/gnucash-4.8/temp/build.log
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-12-06 12:01:19 UTC
Probably will be fixed by bug 882147.

emerge --info too pls?
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-12-06 12:04:27 UTC
(In reply to Sam James from comment #3)
> Probably
> https://github.com/Gnucash/gnucash/commit/
> 4a75baa4c6772d3a864455e50c323a38c228af9c (in 4.10+).

... or https://github.com/Gnucash/gnucash/commit/81b9a022353a32ad1f913a91ad999f93b1d09bd7.