The following issues were found
Userland/Libraries/LibGUI/FileSystemModel.cpp
1 issues
Line: 68
Column: 35
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
}
if (S_ISDIR(mode)) {
is_accessible_directory = access(full_path.characters(), R_OK | X_OK) == 0;
}
return true;
}
Reported by FlawFinder.
Kernel/Bus/VirtIO/VirtIO.h
1 issues
Userland/Libraries/LibGUI/Notification.cpp
1 issues
Line: 17
class NotificationServerConnection final
: public IPC::ServerConnection<NotificationClientEndpoint, NotificationServerEndpoint>
, public NotificationClientEndpoint {
C_OBJECT(NotificationServerConnection)
friend class Notification;
public:
virtual void die() override
Reported by Cppcheck.
Userland/Utilities/utmpupdate.cpp
1 issues
Line: 52
Column: 38
CWE codes:
362
dbgln("Updating utmp from UID={} GID={} EGID={} PID={}", getuid(), getgid(), getegid(), pid);
auto file_or_error = Core::File::open("/var/run/utmp", Core::OpenMode::ReadWrite);
if (file_or_error.is_error()) {
dbgln("Error: {}", file_or_error.error());
return 1;
}
Reported by FlawFinder.
Kernel/TTY/MasterPTY.h
1 issues
Line: 38
Column: 31
CWE codes:
120
20
private:
explicit MasterPTY(unsigned index, NonnullOwnPtr<DoubleBuffer> buffer);
// ^CharacterDevice
virtual KResultOr<size_t> read(FileDescription&, u64, UserOrKernelBuffer&, size_t) override;
virtual KResultOr<size_t> write(FileDescription&, u64, const UserOrKernelBuffer&, size_t) override;
virtual bool can_read(const FileDescription&, size_t) const override;
virtual bool can_write(const FileDescription&, size_t) const override;
virtual KResult close() override;
virtual bool is_master_pty() const override { return true; }
Reported by FlawFinder.
Userland/Libraries/LibGUI/TreeView.h
1 issues
Line: 72
Column: 72
CWE codes:
362
struct MetadataForIndex;
MetadataForIndex& ensure_metadata_for_index(const ModelIndex&) const;
void set_open_state_of_all_in_subtree(const ModelIndex& root, bool open);
mutable HashMap<void*, NonnullOwnPtr<MetadataForIndex>> m_view_metadata;
RefPtr<Gfx::Bitmap> m_expand_bitmap;
RefPtr<Gfx::Bitmap> m_collapse_bitmap;
Reported by FlawFinder.
Userland/Libraries/LibGUI/VimEditingEngine.cpp
1 issues
Line: 138
Column: 13
CWE codes:
126
// from the keycode itself.
char const* keycode_str = key_code_to_string(key);
if (strlen(keycode_str) == 1 && (isalpha(keycode_str[0]) || isspace(keycode_str[0]))) {
m_next_character = tolower(keycode_str[0]);
m_unit = Unit::Find;
} else {
m_unit = Unit::Unknown;
}
Reported by FlawFinder.
Userland/Utilities/w.cpp
1 issues
Line: 46
Column: 38
CWE codes:
362
unveil(nullptr, nullptr);
auto file_or_error = Core::File::open("/var/run/utmp", Core::OpenMode::ReadOnly);
if (file_or_error.is_error()) {
warnln("Error: {}", file_or_error.error());
return 1;
}
auto& file = *file_or_error.value();
Reported by FlawFinder.
Kernel/Syscalls/umask.cpp
1 issues
Line: 15
Column: 40
CWE codes:
732
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
REQUIRE_PROMISE(stdio);
auto old_mask = m_protected_values.umask;
ProtectedDataMutationScope scope { *this };
m_protected_values.umask = mask & 0777;
return old_mask;
}
Reported by FlawFinder.
Userland/Utilities/nproc.cpp
1 issues
Line: 20
Column: 16
CWE codes:
362
}
auto file = Core::File::construct("/proc/cpuinfo");
if (!file->open(Core::OpenMode::ReadOnly)) {
perror("Core::File::open()");
return 1;
}
auto json = JsonValue::from_string({ file->read_all() });
Reported by FlawFinder.