~aleteoryx/muditaos

778118dac0f2558e9bd685b903a1ce6ad4d56908 — Lucjan Bryndza 4 years ago 9fba3f1
[EGD-7658] Fix unsafe usage of std::filesystem::file_size

Find and fix unsafe usage of the file_size in the MuditaOS
filesystem

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
1 files changed, 4 insertions(+), 0 deletions(-)

M module-gui/gui/core/ImageManager.cpp
M module-gui/gui/core/ImageManager.cpp => module-gui/gui/core/ImageManager.cpp +4 -0
@@ 120,6 120,10 @@ namespace gui
    {

        auto file = std::fopen(filename.c_str(), "rb");
        if (!file) {
            LOG_ERROR(" Unable to open file %s", filename.c_str());
            return nullptr;
        }

        auto fileSize = std::filesystem::file_size(filename);