The following issues were found

Userland/Applications/Browser/BookmarksBarWidget.cpp
1 issues
There is an unknown macro here somewhere. Configuration is required. If C_OBJECT is a macro then please configure it.
Error

Line: 27

              namespace {

class BookmarkEditor final : public GUI::Dialog {
    C_OBJECT(BookmarkEditor)

public:
    static Vector<JsonValue>
    edit_bookmark(Window* parent_window, const StringView& title, const StringView& url)
    {

            

Reported by Cppcheck.

Userland/Libraries/LibC/strings.cpp
1 issues
bcopy - Does not check for buffer overflows when copying to destination
Security

Line: 19 Column: 6 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                  memset(dest, 0, n);
}

void bcopy(const void* src, void* dest, size_t n)
{
    memmove(dest, src, n);
}

static char foldcase(char ch)

            

Reported by FlawFinder.

Userland/Libraries/LibC/strings.h
1 issues
bcopy - Does not check for buffer overflows when copying to destination
Security

Line: 17 Column: 6 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              int strcasecmp(const char*, const char*);
int strncasecmp(const char*, const char*, size_t);
void bzero(void*, size_t);
void bcopy(const void*, void*, size_t);

__END_DECLS

            

Reported by FlawFinder.

Kernel/CMOS.cpp
1 issues
read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 12 Column: 4 CWE codes: 120 20

              
namespace CMOS {

u8 read(u8 index)
{
    IO::out8(0x70, index);
    return IO::in8(0x71);
}


            

Reported by FlawFinder.

Userland/Libraries/LibC/sys/socket.cpp
1 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 95 Column: 9 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                  msghdr msg = { addr ? &internal_addr : nullptr, addr ? (socklen_t)sizeof(internal_addr) : 0, &iov, 1, nullptr, 0, 0 };
    ssize_t rc = recvmsg(sockfd, &msg, flags);
    if (rc >= 0 && addr) {
        memcpy(addr, &internal_addr, min(*addr_length, msg.msg_namelen));
        *addr_length = msg.msg_namelen;
    }
    return rc;
}


            

Reported by FlawFinder.

Userland/Utilities/ls.cpp
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 225 Column: 9 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

              {
    static String s_hostname;
    if (s_hostname.is_null()) {
        char buffer[HOST_NAME_MAX];
        if (gethostname(buffer, sizeof(buffer)) == 0)
            s_hostname = buffer;
        else
            s_hostname = "localhost";
    }

            

Reported by FlawFinder.

Userland/Libraries/LibC/sys/statvfs.cpp
1 issues
strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 16 Column: 49 CWE codes: 126

              
int statvfs(const char* path, struct statvfs* buf)
{
    Syscall::SC_statvfs_params params { { path, strlen(path) }, buf };
    int rc = syscall(SC_statvfs, &params);
    __RETURN_WITH_ERRNO(rc, rc, -1);
}

int fstatvfs(int fd, struct statvfs* buf)

            

Reported by FlawFinder.

Userland/Utilities/lsirq.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: 30 Column: 27 CWE codes: 362

                  unveil(nullptr, nullptr);

    auto proc_interrupts = Core::File::construct("/proc/interrupts");
    if (!proc_interrupts->open(Core::OpenMode::ReadOnly)) {
        warnln("Error: {}", proc_interrupts->error_string());
        return 1;
    }

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

            

Reported by FlawFinder.

Userland/Libraries/LibC/syslog.h
1 issues
syslog - If syslog's format strings can be influenced by an attacker, they can be exploited
Security

Line: 149 Column: 6 CWE codes: 134
Suggestion: Use a constant format string for syslog

              #endif

/* The re-entrant versions are an OpenBSD extension we also implement. */
void syslog(int, const char*, ...);
void syslog_r(int, struct syslog_data*, const char*, ...);
void vsyslog(int, const char* message, va_list);
void vsyslog_r(int, struct syslog_data* data, const char* message, va_list);
void openlog(const char*, int, int);
void openlog_r(const char*, int, int, struct syslog_data*);

            

Reported by FlawFinder.

Userland/Applications/Assistant/main.cpp
1 issues
There is an unknown macro here somewhere. Configuration is required. If C_OBJECT is a macro then please configure it.
Error

Line: 36

              };

class ResultRow final : public GUI::Widget {
    C_OBJECT(ResultRow)
public:
    ResultRow()
    {
        auto& layout = set_layout<GUI::HorizontalBoxLayout>();
        layout.set_spacing(12);

            

Reported by Cppcheck.