The following issues were found

Userland/DevTools/HackStudio/FindInFilesWidget.h
1 issues
There is an unknown macro here somewhere. Configuration is required. If C_OBJECT is a macro then please configure it.
Error

Line: 17

              namespace HackStudio {

class FindInFilesWidget final : public GUI::Widget {
    C_OBJECT(FindInFilesWidget)
public:
    virtual ~FindInFilesWidget() override { }

    void focus_textbox_and_select_all();


            

Reported by Cppcheck.

Userland/DevTools/HackStudio/GMLPreviewWidget.h
1 issues
There is an unknown macro here somewhere. Configuration is required. If C_OBJECT is a macro then please configure it.
Error

Line: 15

              namespace HackStudio {

class GMLPreviewWidget final : public GUI::Widget {
    C_OBJECT(GMLPreviewWidget)
public:
    void load_gml(String const&);

private:
    explicit GMLPreviewWidget(String const&);

            

Reported by Cppcheck.

Userland/DevTools/HackStudio/Git/DiffViewer.h
1 issues
There is an unknown macro here somewhere. Configuration is required. If C_OBJECT is a macro then please configure it.
Error

Line: 16

              
namespace HackStudio {
class DiffViewer final : public GUI::AbstractScrollableWidget {
    C_OBJECT(DiffViewer)
public:
    virtual ~DiffViewer() override;

    void set_content(const String& original, const String& diff);


            

Reported by Cppcheck.

Userland/Utilities/fortune.cpp
1 issues
open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 87 Column: 16 CWE codes: 362

                  args_parser.parse(argc, argv);

    auto file = Core::File::construct(path);
    if (!file->open(Core::OpenMode::ReadOnly)) {
        warnln("Couldn't open {} for reading: {}", path, file->error_string());
        return 1;
    }

    if (pledge("stdio", nullptr) < 0) {

            

Reported by FlawFinder.

Userland/DevTools/HackStudio/Git/GitWidget.cpp
1 issues
open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 152 Column: 20 CWE codes: 362

              {
    if (!m_git_repo->is_tracked(file_path)) {
        auto file = Core::File::construct(file_path.string());
        if (!file->open(Core::OpenMode::ReadOnly)) {
            perror("open");
            VERIFY_NOT_REACHED();
        }

        auto content = file->read_all();

            

Reported by FlawFinder.

Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp
1 issues
fopen - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 311 Column: 23 CWE codes: 362

                      //TODO: Implement a metadata parser for the uncomfortably numerous popular embedded metadata formats

        if (!entry.extended_info->file_size_in_bytes.has_value()) {
            FILE* f = fopen(entry.path.characters(), "r");
            VERIFY(f != nullptr);
            fseek(f, 0, SEEK_END);
            entry.extended_info->file_size_in_bytes = ftell(f);
            fclose(f);
        }

            

Reported by FlawFinder.

Userland/DevTools/HackStudio/LanguageServers/Cpp/Tests.cpp
1 issues
open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 60 Column: 29 CWE codes: 362

              
static void add_file(FileDB& filedb, const String& name)
{
    auto file = Core::File::open(LexicalPath::join(TESTS_ROOT_DIR, name).string(), Core::OpenMode::ReadOnly);
    VERIFY(!file.is_error());
    filedb.add(name, file.value()->fd());
}

void test_complete_local_args()

            

Reported by FlawFinder.

Userland/DevTools/HackStudio/LanguageServers/Cpp/Tests/complete_includes.cpp
1 issues
No pair for character ("). Can't process file. File is either invalid or unicode, which is currently not supported.
Error

Line: 1

              #include "sample_heade
#include <sys/cdef

void foo() {}


            

Reported by Cppcheck.

Userland/DevTools/HackStudio/LanguageServers/Cpp/Tests/parameters_hint1.cpp
1 issues
Unmatched '('. Configuration: ''.
Error

Line: 7

              {
    foo();
    foo(123, 'b');
    foo(
}

            

Reported by Cppcheck.

Userland/Utilities/gml-format.cpp
1 issues
open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 22 Column: 42 CWE codes: 362

                      file = Core::File::standard_input();
    } else {
        auto open_mode = inplace ? Core::OpenMode::ReadWrite : Core::OpenMode::ReadOnly;
        auto file_or_error = Core::File::open(path, open_mode);
        if (file_or_error.is_error()) {
            warnln("Could not open {}: {}", path, file_or_error.error());
            return false;
        }
        file = file_or_error.value();

            

Reported by FlawFinder.