The following issues were found

Userland/Libraries/LibChess/UCIEndpoint.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 Chess::UCI {

class Endpoint : public Core::Object {
    C_OBJECT(Endpoint)
public:
    virtual ~Endpoint() override { }

    Endpoint() { }
    Endpoint(NonnullRefPtr<Core::IODevice> in, NonnullRefPtr<Core::IODevice> out);

            

Reported by Cppcheck.

Tests/LibWasm/test-wasm.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: 19 Column: 29 CWE codes: 362

                  auto filename = vm.argument(0).to_string(global_object);
    if (vm.exception())
        return {};
    auto file = Core::File::open(filename, Core::OpenMode::ReadOnly);
    if (file.is_error()) {
        vm.throw_exception<JS::TypeError>(global_object, file.error().string());
        return {};
    }
    auto contents = file.value()->read_all();

            

Reported by FlawFinder.

Userland/Libraries/LibCompress/Deflate.h
1 issues
read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 80 Column: 12 CWE codes: 120 20

                  DeflateDecompressor(InputStream&);
    ~DeflateDecompressor();

    size_t read(Bytes) override;
    bool read_or_error(Bytes) override;
    bool discard_or_error(size_t) override;

    bool unreliable_eof() const override;
    bool handle_any_error() override;

            

Reported by FlawFinder.

Tests/LibRegex/RegexLibC.cpp
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 1069 Column: 5 CWE codes: 119 120
Suggestion: Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length

              
    EXPECT_EQ(regcomp(&regex, pattern.characters(), REG_EXTENDED), REG_EBRACK);
    EXPECT_EQ(regexec(&regex, "asdf@asdf.com", 0, NULL, 0), REG_EBRACK);
    char buf[1024];
    size_t buflen = 1024;
    auto len = regerror(0, &regex, buf, buflen);
    String expected = "Error during parsing of regular expression:\n    ^[A-Z0-9[a-z._%+-]{1,64}@[A-Za-z0-9-]{1,63}\\.{1,125}[A-Za-z]{2,63}$\n             ^---- [ ] imbalance.";
    for (size_t i = 0; i < len; ++i) {
        EXPECT_EQ(buf[i], expected[i]);

            

Reported by FlawFinder.

Userland/Libraries/LibCompress/Gzip.h
1 issues
read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 45 Column: 12 CWE codes: 120 20

                  GzipDecompressor(InputStream&);
    ~GzipDecompressor();

    size_t read(Bytes) override;
    bool read_or_error(Bytes) override;
    bool discard_or_error(size_t) override;

    bool unreliable_eof() const override;
    bool handle_any_error() override;

            

Reported by FlawFinder.

Tests/LibGfx/TestFontHandling.cpp
1 issues
mkstemp - Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library
Security

Line: 146 Column: 12 CWE codes: 377

                  auto font = Gfx::BitmapFont::create(glyph_height, glyph_width, true, Gfx::FontTypes::Default);

    char path[] = "/tmp/new.font.XXXXXX";
    EXPECT(mkstemp(path) != -1);
    EXPECT(font->write_to_file(path));
    unlink(path);
}

            

Reported by FlawFinder.

Userland/Utilities/tt.cpp
1 issues
usleep - This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified
Security

Line: 111 Column: 9 CWE codes: 676
Suggestion: Use nanosleep(2) or setitimer(2) instead

                      pthread_mutex_lock(&mutex);
        outln("Obnoxious spam!");
        pthread_mutex_unlock(&mutex);
        usleep(10000);
    }
    return 0;
}

int detached_test()

            

Reported by FlawFinder.

Userland/Libraries/LibCore/Command.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: 81 Column: 27 CWE codes: 362

              
    auto read_all_from_pipe = [](int pipe[2]) {
        auto result_file = Core::File::construct();
        if (!result_file->open(pipe[0], Core::OpenMode::ReadOnly, Core::File::ShouldCloseFileDescriptor::Yes)) {
            perror("open");
            VERIFY_NOT_REACHED();
        }
        return String::copy(result_file->read_all());
    };

            

Reported by FlawFinder.

Tests/LibCrypto/TestBigInteger.cpp
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 424 Column: 5 CWE codes: 119 120
Suggestion: Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length

              TEST_CASE(test_bigint_big_endian_export)
{
    auto number = "448378203247"_bigint;
    char exported[8] { 0 };
    auto exported_length = number.export_data({ exported, 8 }, true);
    EXPECT_EQ(exported_length, 5u);
    EXPECT(memcmp(exported + 3, "hello", 5) == 0);
}


            

Reported by FlawFinder.

Userland/Libraries/LibCore/ConfigFile.h
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: 23 Column: 38 CWE codes: 362

                  static NonnullRefPtr<ConfigFile> get_for_lib(const String& lib_name);
    static NonnullRefPtr<ConfigFile> get_for_app(const String& app_name);
    static NonnullRefPtr<ConfigFile> get_for_system(const String& app_name);
    static NonnullRefPtr<ConfigFile> open(const String& path);
    ~ConfigFile();

    bool has_group(const String&) const;
    bool has_key(const String& group, const String& key) const;


            

Reported by FlawFinder.