mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
On Windows boost::filesystem::path's string() produces a string that goes out of scope with the function in which it's called, so returning its c_str() ptr yields freed memory, usually full of garbage. This has an interesting side effect in gnc-file.c's check_file_path(): Since the memory is freed, g_path_get_dirname() reuses it after an iteration or two, writing its result into the same address. The following strcmp naturally returns 0 because it's comparing two instances of the same ptr, so check_file_path falsely reports that the proposed save path is in GNC_USERDATA_DIR.