The following issues were found
src/third_party/boost/libs/log/src/named_scope_format_parser.cpp
1 issues
Line: 475
template< typename CharT >
class named_scope_formatter
{
BOOST_COPYABLE_AND_MOVABLE_ALT(named_scope_formatter)
public:
typedef void result_type;
typedef CharT char_type;
Reported by Cppcheck.
src/third_party/boost/libs/log/src/posix/object_name.cpp
1 issues
Line: 61
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
{
// Note: in the code below, avoid involving locale for string formatting to make sure the names are as stable as possible
typedef typename boost::make_unsigned< Identifier >::type unsigned_id_t;
char buf[std::numeric_limits< unsigned_id_t >::digits10 + 2];
char* p = buf;
typedef karma::uint_generator< unsigned_id_t, 10 > unsigned_id_gen;
karma::generate(p, unsigned_id_gen(), static_cast< unsigned_id_t >(id));
str.append(buf, p);
Reported by FlawFinder.
src/third_party/boost/libs/log/src/record_ostream.cpp
1 issues
Line: 31
namespace boost {
BOOST_LOG_OPEN_NAMESPACE
//! The function initializes the stream and the stream buffer
template< typename CharT >
BOOST_LOG_API void basic_record_ostream< CharT >::init_stream()
{
Reported by Cppcheck.
src/third_party/boost/libs/log/src/setup/init_from_stream.cpp
1 issues
Line: 25
namespace boost {
BOOST_LOG_OPEN_NAMESPACE
//! The function initializes the logging library from a stream containing logging settings
template< typename CharT >
BOOST_LOG_SETUP_API void init_from_stream(std::basic_istream< CharT >& strm)
{
Reported by Cppcheck.
src/third_party/boost/libs/log/src/text_file_backend.cpp
1 issues
Line: 1388
Column: 25
CWE codes:
362
filesystem::create_directories(new_file_name.parent_path());
m_pImpl->m_File.open(new_file_name, m_pImpl->m_FileOpenMode);
if (BOOST_UNLIKELY(!m_pImpl->m_File.is_open()))
{
BOOST_THROW_EXCEPTION(filesystem_error(
"Failed to open file for writing",
new_file_name,
Reported by FlawFinder.
src/third_party/boost/libs/log/src/text_multifile_backend.cpp
1 issues
Line: 94
Column: 25
CWE codes:
362
{
filesystem::path file_name = m_pImpl->make_absolute(m_pImpl->m_FileNameComposer(rec));
filesystem::create_directories(file_name.parent_path());
m_pImpl->m_File.open(file_name, std::ios_base::out | std::ios_base::app);
if (BOOST_LIKELY(m_pImpl->m_File.is_open()))
{
m_pImpl->m_File.write(formatted_message.data(), static_cast< std::streamsize >(formatted_message.size()));
if (m_pImpl->m_AutoNewlineMode != disabled_auto_newline)
{
Reported by FlawFinder.
src/third_party/boost/libs/log/src/threadsafe_queue.cpp
1 issues
Line: 65
Column: 18
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
//! Lock for access synchronization
mutex_type mutex;
// 128 bytes padding is chosen to mitigate false sharing for NetBurst CPUs, which load two cache lines in one go.
unsigned char padding[128U - (sizeof(node_base*) + sizeof(mutex_type)) % 128U];
};
private:
//! Pointer to the beginning of the queue
pointer m_Head;
Reported by FlawFinder.
src/third_party/boost/libs/log/src/trivial.cpp
1 issues
Line: 128
Column: 18
CWE codes:
327
Suggestion:
Use a more secure technique for acquiring random values
string_type str;
strm >> str;
if (BOOST_UNLIKELY(!boost::log::trivial::from_string(str.data(), str.size(), lvl)))
strm.setstate(std::ios_base::failbit);
}
return strm;
}
Reported by FlawFinder.
src/third_party/boost/libs/log/src/windows/mapped_shared_memory.cpp
1 issues
Line: 143
Column: 28
CWE codes:
362
}
//! Opens the existing file mapping for the shared memory segment
void mapped_shared_memory::open(const wchar_t* name)
{
BOOST_ASSERT(m_handle == NULL);
// Note: FILE_MAP_WRITE implies reading permission as well
boost::winapi::HANDLE_ h = boost::winapi::OpenFileMappingW(boost::winapi::FILE_MAP_WRITE_ | boost::winapi::SECTION_QUERY_, false, name);
Reported by FlawFinder.
src/third_party/boost/libs/log/src/windows/mapped_shared_memory.hpp
1 issues
Line: 72
Column: 10
CWE codes:
362
//! Creates a new file mapping for the shared memory segment or opens the existing one. Returns \c true if the region was created and \c false if an existing one was opened.
bool create_or_open(const wchar_t* name, std::size_t size, permissions const& perms = permissions());
//! Opens the existing file mapping for the shared memory segment
void open(const wchar_t* name);
//! Maps the file mapping into the current process memory
void map();
//! Unmaps the file mapping
void unmap();
Reported by FlawFinder.