Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Os/Cpu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
CpuInterface(const CpuInterface& other) = delete;

//! \brief assignment operator is forbidden
virtual CpuInterface& operator=(const CpuInterface& other) = delete;
virtual CpuInterface& operator=(const CpuInterface& other) = delete; // NOSONAR (cpp:S3657)

Check warning on line 30 in Os/Cpu.hpp

View workflow job for this annotation

GitHub Actions / Check Spelling

`NOSONAR` is not a recognized word. (unrecognized-spelling)

//! \brief Request the count of the CPUs detected by the system
//!
Expand Down
2 changes: 1 addition & 1 deletion Os/File.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ File::Status File::readline(U8* buffer, FwSizeType& size, File::WaitType wait) {
size = 0;
return File::Status::INVALID_MODE;
}
FwSizeType original_location;
FwSizeType original_location = 0;
File::Status status = this->position(original_location);
if (status != Os::File::Status::OP_OK) {
size = 0;
Expand Down
2 changes: 1 addition & 1 deletion Os/FileSystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
FileSystemInterface(const FileSystemInterface& other) = delete;

//! \brief assignment operator is forbidden
FileSystemInterface& operator=(const FileSystemInterface& other) = delete;
FileSystemInterface& operator=(const FileSystemInterface& other) = delete; // NOSONAR (cpp:S3657)

Check warning on line 60 in Os/FileSystem.hpp

View workflow job for this annotation

GitHub Actions / Check Spelling

`NOSONAR` is not a recognized word. (unrecognized-spelling)

//! \brief return the underlying FileSystem handle (implementation specific)
//! \return internal FileSystem handle representation
Expand Down
3 changes: 3 additions & 0 deletions Os/Generic/PriorityQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ QueueInterface::Status PriorityQueue::create(FwEnumStoreType id,
U8* data = nullptr;
U8* heap_pointer = nullptr;

// Prevent integer overflow when computing allocation size (depth * sizeof(FwSizeType))
FW_ASSERT(depth < std::numeric_limits<FwSizeType>::max() / sizeof(FwSizeType));

// Allocate indices list and construct it when valid
size = depth * sizeof(FwSizeType);
allocation = allocator.allocate(identifier, size, alignof(FwSizeType));
Expand Down
2 changes: 1 addition & 1 deletion Os/Generic/Types/MaxHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ MaxHeap::~MaxHeap() {

void MaxHeap::create(FwSizeType capacity, Fw::ByteArray heap_allocation) {
FW_ASSERT(this->m_heap == nullptr);
FW_ASSERT(heap_allocation.size >= (capacity * sizeof(Node)), static_cast<FwAssertArgType>(capacity),
FW_ASSERT((heap_allocation.size / sizeof(Node)) >= capacity, static_cast<FwAssertArgType>(capacity),
static_cast<FwAssertArgType>(heap_allocation.size));
FW_ASSERT(heap_allocation.bytes != nullptr);
// Loop bounds will overflow if capacity set to the max allowable value
Expand Down
2 changes: 1 addition & 1 deletion Os/Memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
virtual ~MemoryInterface() = default;

//! \brief copy constructor is forbidden
MemoryInterface(const MemoryInterface& other) = delete;
MemoryInterface(const MemoryInterface& other) = delete; // NOSONAR (cpp:S3657)

Check warning on line 27 in Os/Memory.hpp

View workflow job for this annotation

GitHub Actions / Check Spelling

`NOSONAR` is not a recognized word. (unrecognized-spelling)

//! \brief assignment operator is forbidden
virtual MemoryInterface& operator=(const MemoryInterface& other) = delete;
Expand Down
2 changes: 1 addition & 1 deletion Os/Queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
QueueInterface(const QueueInterface* other) = delete;

//! \brief assignment operator is forbidden
virtual QueueInterface& operator=(const QueueInterface& other) = delete;
virtual QueueInterface& operator=(const QueueInterface& other) = delete; // NOSONAR (cpp:S3657)

Check warning on line 64 in Os/Queue.hpp

View workflow job for this annotation

GitHub Actions / Check Spelling

`NOSONAR` is not a recognized word. (unrecognized-spelling)

//! \brief create queue storage
//!
Expand Down
Loading