Check returned value of fopen() #9775

issue viennadd opened this issue on February 16, 2017
  1. viennadd commented at 10:52 AM on February 16, 2017: none

    util.cpp#L216 if fopen failed, a null file pointer could be passed to FileWriteStr(vMsgsBeforeOpenLog->front(), fileout);

  2. fanquake renamed this:
    checks of returned value of fopen
    Check of returned value of fopen()
    on Feb 16, 2017
  3. fanquake renamed this:
    Check of returned value of fopen()
    Check returned value of fopen()
    on Feb 16, 2017
  4. MarcoFalke added the label Easy to implement on Feb 18, 2017
  5. kirit93 commented at 6:24 AM on February 19, 2017: contributor

    As I've understood the problem, the solution would be simply passing a "NULL" to FileWriteStr as the second argument and an empty string as the first argument. Is that correct or did you have something else in mind?

  6. laanwj commented at 1:02 PM on February 19, 2017: member

    I'd say the most straightforward and correct solution is to put everything until the delete vMsgsBeforeOpenLog under the if (fileout) conditional.

  7. kirit93 referenced this in commit 8a2f559850 on Feb 19, 2017
  8. kirit93 cross-referenced this on Feb 19, 2017 from issue Fix Issue #9775 (Check returned value of fopen) by kirit93
  9. viennadd closed this on Feb 19, 2017

  10. kirit93 referenced this in commit 40f11f8872 on Feb 20, 2017
  11. laanwj referenced this in commit 8ad31f9aa3 on Feb 21, 2017
  12. laanwj referenced this in commit e22c0671c7 on Feb 21, 2017
  13. ryanofsky cross-referenced this on Mar 3, 2017 from issue Save watch only key timestamps when reimporting keys by ryanofsky
  14. ryanofsky cross-referenced this on Mar 3, 2017 from issue Unify CWalletTx construction by ryanofsky
  15. ryanofsky cross-referenced this on Mar 3, 2017 from issue [wallet] [refactor] Simplify getbalance implementation by ryanofsky
  16. ryanofsky cross-referenced this on Mar 3, 2017 from issue Factor out CWallet::nTimeSmart computation into a method. by ryanofsky
  17. ryanofsky cross-referenced this on Mar 3, 2017 from issue Let wallet importmulti RPC accept labels for standard scriptPubKeys by ryanofsky
  18. codablock referenced this in commit 15a035b9c0 on Jan 26, 2018
  19. andvgal referenced this in commit 668a1171d2 on Jan 6, 2019
  20. CryptoCentric referenced this in commit 0865c59b79 on Feb 27, 2019
  21. bitcoin locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-19 06:54 UTC