The following issues were found
Userland/Applications/FontEditor/GlyphEditorWidget.h
1 issues
Line: 17
static constexpr int s_max_height = 36;
class GlyphEditorWidget final : public GUI::Frame {
C_OBJECT(GlyphEditorWidget)
public:
enum Mode {
Paint,
Move
};
Reported by Cppcheck.
Userland/Libraries/LibC/serenity.cpp
1 issues
Line: 128
Column: 104
CWE codes:
126
int setkeymap(const char* name, const u32* map, u32* const shift_map, const u32* alt_map, const u32* altgr_map, const u32* shift_altgr_map)
{
Syscall::SC_setkeymap_params params { map, shift_map, alt_map, altgr_map, shift_altgr_map, { name, strlen(name) } };
return syscall(SC_setkeymap, ¶ms);
}
int getkeymap(char* name_buffer, size_t name_buffer_size, u32* map, u32* shift_map, u32* alt_map, u32* altgr_map, u32* shift_altgr_map)
{
Reported by FlawFinder.
Userland/Utilities/keymap.cpp
1 issues
Line: 71
Column: 42
CWE codes:
362
return rc;
}
auto mapper_config(Core::ConfigFile::open("/etc/Keyboard.ini"));
mapper_config->write_entry("Mapping", "Keymap", path);
mapper_config->sync();
return rc;
}
Reported by FlawFinder.
Userland/Libraries/LibC/spawn.cpp
1 issues
Line: 157
Column: 25
CWE codes:
362
int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t* actions, int want_fd, const char* path, int flags, mode_t mode)
{
actions->state->actions.append([want_fd, path, flags, mode]() {
int opened_fd = open(path, flags, mode);
if (opened_fd < 0 || opened_fd == want_fd)
return opened_fd;
if (int rc = dup2(opened_fd, want_fd); rc < 0)
return rc;
return close(opened_fd);
Reported by FlawFinder.
Userland/Applications/FontEditor/FontEditor.cpp
1 issues
Line: 571
Column: 28
CWE codes:
362
auto& help_menu = window.add_menu("&Help");
help_menu.add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_protocol("/usr/share/man/man1/FontEditor.md"), "/bin/Help");
}));
help_menu.add_action(GUI::CommonActions::make_about_action("Font Editor", GUI::Icon::default_icon("app-font-editor"), &window));
}
bool FontEditorWidget::save_as(const String& path)
Reported by FlawFinder.
Userland/Applications/FileManager/PropertiesWindow.h
1 issues
Userland/Applications/FileManager/DirectoryView.h
1 issues
Line: 52
Column: 10
CWE codes:
362
virtual ~DirectoryView() override;
void open(String const& path);
String path() const { return model().root_path(); }
void open_parent_directory();
void open_previous_directory();
void open_next_directory();
int path_history_size() const { return m_path_history.size(); }
Reported by FlawFinder.
Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp
1 issues
Line: 88
Column: 40
CWE codes:
362
void BackgroundSettingsWidget::load_current_settings()
{
auto ws_config = Core::ConfigFile::open("/etc/WindowServer.ini");
auto wm_config = Core::ConfigFile::get_for_app("WindowManager");
auto selected_wallpaper = wm_config->read_entry("Background", "Wallpaper", "");
if (!selected_wallpaper.is_empty()) {
auto index = static_cast<GUI::FileSystemModel*>(m_wallpaper_view->model())->index(selected_wallpaper, m_wallpaper_view->model_column());
Reported by FlawFinder.
Userland/Applications/Browser/main.cpp
1 issues
Line: 110
Column: 48
CWE codes:
362
Browser::g_home_url = m_config->read_entry("Preferences", "Home", "about:blank");
Browser::g_search_engine = m_config->read_entry("Preferences", "SearchEngine", {});
auto ad_filter_list_or_error = Core::File::open(String::formatted("{}/BrowserContentFilters.txt", Core::StandardPaths::config_directory()), Core::OpenMode::ReadOnly);
if (!ad_filter_list_or_error.is_error()) {
auto& ad_filter_list = *ad_filter_list_or_error.value();
while (!ad_filter_list.eof()) {
auto line = ad_filter_list.read_line();
if (line.is_empty())
Reported by FlawFinder.
Userland/Applications/Browser/InspectorWidget.h
1 issues
Line: 15
namespace Browser {
class InspectorWidget final : public GUI::Widget {
C_OBJECT(InspectorWidget)
public:
virtual ~InspectorWidget();
void set_document(Web::DOM::Document*);
void set_dom_json(String);
Reported by Cppcheck.