The following issues were found
Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h
1 issues
Line: 54
Column: 28
CWE codes:
362
unsigned status() const { return m_status; };
String response_text() const;
DOM::ExceptionOr<void> open(const String& method, const String& url);
DOM::ExceptionOr<void> send();
DOM::ExceptionOr<void> set_request_header(const String& header, const String& value);
String get_response_header(const String& name) { return m_response_headers.get(name).value_or({}); }
Reported by FlawFinder.
Userland/Libraries/LibWebSocket/Impl/AbstractWebSocketImpl.h
1 issues
Line: 30
Column: 24
CWE codes:
120
20
virtual String read_line(size_t size) = 0;
virtual bool can_read() = 0;
virtual ByteBuffer read(int max_size) = 0;
virtual bool send(ReadonlyBytes) = 0;
virtual bool eof() = 0;
Reported by FlawFinder.
Userland/Utilities/watch.cpp
1 issues
Line: 129
Column: 13
CWE codes:
676
Suggestion:
Use nanosleep(2) or setitimer(2) instead
while (true) {
int usecs_to_sleep = usecs_from(now, next_run_time);
while (usecs_to_sleep > 0) {
usleep(usecs_to_sleep);
now = get_current_time();
usecs_to_sleep = usecs_from(now, next_run_time);
}
// Clear the screen, then reset the cursor position to the top left.
warn("\033[H\033[2J");
Reported by FlawFinder.
Userland/Libraries/LibWebSocket/Impl/TCPWebSocketConnectionImpl.h
1 issues
Line: 33
Column: 24
CWE codes:
120
20
virtual String read_line(size_t size) override;
virtual bool can_read() override;
virtual ByteBuffer read(int max_size) override;
virtual bool send(ReadonlyBytes data) override;
virtual bool eof() override;
Reported by FlawFinder.
Kernel/Arch/x86/common/ProcessorInfo.cpp
1 issues
Line: 59
Column: 22
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
u32 max_extended_leaf = CPUID(0x80000000).eax();
if (max_extended_leaf >= 0x80000004) {
alignas(u32) char buffer[48];
u32* bufptr = reinterpret_cast<u32*>(buffer);
auto copy_brand_string_part_to_buffer = [&](u32 i) {
CPUID cpuid(0x80000002 + i);
*bufptr++ = cpuid.eax();
*bufptr++ = cpuid.ebx();
Reported by FlawFinder.
Userland/Libraries/LibWebSocket/Impl/TLSv12WebSocketConnectionImpl.h
1 issues
Line: 32
Column: 24
CWE codes:
120
20
virtual String read_line(size_t size) override;
virtual bool can_read() override;
virtual ByteBuffer read(int max_size) override;
virtual bool send(ReadonlyBytes data) override;
virtual bool eof() override;
Reported by FlawFinder.
Kernel/KString.h
1 issues
Line: 40
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
}
size_t m_length { 0 };
char m_characters[0];
};
}
namespace AK {
Reported by FlawFinder.
Kernel/KResult.h
1 issues
Line: 165
Column: 20
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
private:
union {
alignas(T) char m_storage[sizeof(T)];
KResult m_error;
};
bool m_is_error { false };
bool m_have_storage { false };
};
Reported by FlawFinder.
Userland/Services/AudioServer/Mixer.cpp
1 issues
Line: 32
Column: 20
CWE codes:
362
"AudioServer[mixer]"))
, m_config(move(config))
{
if (!m_device->open(Core::OpenMode::WriteOnly)) {
dbgln("Can't open audio device: {}", m_device->error_string());
return;
}
pthread_mutex_init(&m_pending_mutex, nullptr);
Reported by FlawFinder.
Userland/Services/ChessEngine/ChessEngine.cpp
1 issues
Line: 37
Column: 5
CWE codes:
327
Suggestion:
Use a more secure technique for acquiring random values
// FIXME: Add different ways to terminate search.
VERIFY(command.movetime.has_value());
srand(get_random<u32>());
Core::ElapsedTimer elapsed_time;
elapsed_time.start();
MCTSTree mcts(m_board);
Reported by FlawFinder.