Flawfinder version 2.0.10, (C) 2001-2019 David A. Wheeler.
Number of rules (primarily dangerous function names) in C/C++ ruleset: 223
Examining data/centreon-clib-19.10.0/src/clib.cc
Examining data/centreon-clib-19.10.0/src/clib/version.cc
Examining data/centreon-clib-19.10.0/src/concurrency/condvar_posix.cc
Examining data/centreon-clib-19.10.0/src/concurrency/condvar_win32.cc
Examining data/centreon-clib-19.10.0/src/concurrency/mutex_win32.cc
Examining data/centreon-clib-19.10.0/src/concurrency/read_write_lock_posix.cc
Examining data/centreon-clib-19.10.0/src/concurrency/read_write_lock_win32.cc
Examining data/centreon-clib-19.10.0/src/concurrency/runnable.cc
Examining data/centreon-clib-19.10.0/src/concurrency/semaphore_posix.cc
Examining data/centreon-clib-19.10.0/src/concurrency/semaphore_win32.cc
Examining data/centreon-clib-19.10.0/src/concurrency/thread_pool.cc
Examining data/centreon-clib-19.10.0/src/concurrency/thread_posix.cc
Examining data/centreon-clib-19.10.0/src/concurrency/thread_win32.cc
Examining data/centreon-clib-19.10.0/src/exceptions/basic.cc
Examining data/centreon-clib-19.10.0/src/exceptions/interruption.cc
Examining data/centreon-clib-19.10.0/src/handle.cc
Examining data/centreon-clib-19.10.0/src/handle_action.cc
Examining data/centreon-clib-19.10.0/src/handle_listener.cc
Examining data/centreon-clib-19.10.0/src/handle_manager.cc
Examining data/centreon-clib-19.10.0/src/handle_manager_posix.cc
Examining data/centreon-clib-19.10.0/src/handle_manager_win32.cc
Examining data/centreon-clib-19.10.0/src/io/directory_entry.cc
Examining data/centreon-clib-19.10.0/src/io/file_entry.cc
Examining data/centreon-clib-19.10.0/src/io/file_stream.cc
Examining data/centreon-clib-19.10.0/src/library_posix.cc
Examining data/centreon-clib-19.10.0/src/library_win32.cc
Examining data/centreon-clib-19.10.0/src/logging/backend.cc
Examining data/centreon-clib-19.10.0/src/logging/engine.cc
Examining data/centreon-clib-19.10.0/src/logging/file.cc
Examining data/centreon-clib-19.10.0/src/logging/syslogger.cc
Examining data/centreon-clib-19.10.0/src/logging/temp_logger.cc
Examining data/centreon-clib-19.10.0/src/misc/argument.cc
Examining data/centreon-clib-19.10.0/src/misc/command_line.cc
Examining data/centreon-clib-19.10.0/src/misc/get_options.cc
Examining data/centreon-clib-19.10.0/src/misc/stringifier.cc
Examining data/centreon-clib-19.10.0/src/process_manager_posix.cc
Examining data/centreon-clib-19.10.0/src/process_manager_win32.cc
Examining data/centreon-clib-19.10.0/src/process_posix.cc
Examining data/centreon-clib-19.10.0/src/process_win32.cc
Examining data/centreon-clib-19.10.0/src/task.cc
Examining data/centreon-clib-19.10.0/src/task_manager.cc
Examining data/centreon-clib-19.10.0/src/timestamp.cc
Examining data/centreon-clib-19.10.0/test/bin_test_process_output.cc
Examining data/centreon-clib-19.10.0/test/clib/version/major.cc
Examining data/centreon-clib-19.10.0/test/clib/version/minor.cc
Examining data/centreon-clib-19.10.0/test/clib/version/patch.cc
Examining data/centreon-clib-19.10.0/test/clib/version/string.cc
Examining data/centreon-clib-19.10.0/test/concurrency/locker_constructor.cc
Examining data/centreon-clib-19.10.0/test/concurrency/mutex_is_recursive.cc
Examining data/centreon-clib-19.10.0/test/concurrency/runnable_copy.cc
Examining data/centreon-clib-19.10.0/test/concurrency/thread_msleep.cc
Examining data/centreon-clib-19.10.0/test/concurrency/thread_nsleep.cc
Examining data/centreon-clib-19.10.0/test/concurrency/thread_pool_constructor.cc
Examining data/centreon-clib-19.10.0/test/concurrency/thread_pool_max_thread_count.cc
Examining data/centreon-clib-19.10.0/test/concurrency/thread_pool_start.cc
Examining data/centreon-clib-19.10.0/test/concurrency/thread_sleep.cc
Examining data/centreon-clib-19.10.0/test/concurrency/thread_usleep.cc
Examining data/centreon-clib-19.10.0/test/concurrency/thread_wait.cc
Examining data/centreon-clib-19.10.0/test/exceptions/basic_constructor.cc
Examining data/centreon-clib-19.10.0/test/exceptions/basic_copy.cc
Examining data/centreon-clib-19.10.0/test/exceptions/basic_insert_char.cc
Examining data/centreon-clib-19.10.0/test/exceptions/basic_insert_int.cc
Examining data/centreon-clib-19.10.0/test/exceptions/basic_insert_long.cc
Examining data/centreon-clib-19.10.0/test/exceptions/basic_insert_longlong.cc
Examining data/centreon-clib-19.10.0/test/exceptions/basic_insert_pchar.cc
Examining data/centreon-clib-19.10.0/test/exceptions/basic_insert_uint.cc
Examining data/centreon-clib-19.10.0/test/exceptions/basic_insert_ulong.cc
Examining data/centreon-clib-19.10.0/test/exceptions/basic_insert_ulonglong.cc
Examining data/centreon-clib-19.10.0/test/handle_manager_add.cc
Examining data/centreon-clib-19.10.0/test/handle_manager_constructor.cc
Examining data/centreon-clib-19.10.0/test/handle_manager_multiplex.cc
Examining data/centreon-clib-19.10.0/test/handle_manager_remove_by_handle.cc
Examining data/centreon-clib-19.10.0/test/handle_manager_remove_by_handle_listener.cc
Examining data/centreon-clib-19.10.0/test/io/directory_entry/copy.cc
Examining data/centreon-clib-19.10.0/test/io/directory_entry/ctor_default.cc
Examining data/centreon-clib-19.10.0/test/io/directory_entry/current_path.cc
Examining data/centreon-clib-19.10.0/test/io/directory_entry/filter.cc
Examining data/centreon-clib-19.10.0/test/io/file_entry/copy.cc
Examining data/centreon-clib-19.10.0/test/io/file_entry/ctor_default.cc
Examining data/centreon-clib-19.10.0/test/io/file_entry/pathinfo.cc
Examining data/centreon-clib-19.10.0/test/io/file_entry/permission.cc
Examining data/centreon-clib-19.10.0/test/io/file_entry/size.cc
Examining data/centreon-clib-19.10.0/test/io/file_stream/create_exists_remove.cc
Examining data/centreon-clib-19.10.0/test/io/file_stream/ctor_default.cc
Examining data/centreon-clib-19.10.0/test/io/file_stream/read.cc
Examining data/centreon-clib-19.10.0/test/io/file_stream/rename.cc
Examining data/centreon-clib-19.10.0/test/io/file_stream/write.cc
Examining data/centreon-clib-19.10.0/test/library_load.cc
Examining data/centreon-clib-19.10.0/test/library_resolve.cc
Examining data/centreon-clib-19.10.0/test/logging/backend_copy.cc
Examining data/centreon-clib-19.10.0/test/logging/backend_with_pid.cc
Examining data/centreon-clib-19.10.0/test/logging/backend_with_thread_id.cc
Examining data/centreon-clib-19.10.0/test/logging/backend_with_timestamp.cc
Examining data/centreon-clib-19.10.0/test/logging/engine_add.cc
Examining data/centreon-clib-19.10.0/test/logging/engine_is_log.cc
Examining data/centreon-clib-19.10.0/test/logging/engine_log.cc
Examining data/centreon-clib-19.10.0/test/logging/engine_remove_by_backend.cc
Examining data/centreon-clib-19.10.0/test/logging/engine_remove_by_id.cc
Examining data/centreon-clib-19.10.0/test/logging/engine_with_thread.cc
Examining data/centreon-clib-19.10.0/test/logging/file_log.cc
Examining data/centreon-clib-19.10.0/test/logging/file_log_multiline.cc
Examining data/centreon-clib-19.10.0/test/logging/temp_logger_constructor.cc
Examining data/centreon-clib-19.10.0/test/logging/temp_logger_copy.cc
Examining data/centreon-clib-19.10.0/test/logging/temp_logger_do_nothing_char.cc
Examining data/centreon-clib-19.10.0/test/logging/temp_logger_do_nothing_double.cc
Examining data/centreon-clib-19.10.0/test/logging/temp_logger_do_nothing_int.cc
Examining data/centreon-clib-19.10.0/test/logging/temp_logger_do_nothing_long.cc
Examining data/centreon-clib-19.10.0/test/logging/temp_logger_do_nothing_long_long.cc
Examining data/centreon-clib-19.10.0/test/logging/temp_logger_do_nothing_pvoid.cc
Examining data/centreon-clib-19.10.0/test/logging/temp_logger_do_nothing_std_string.cc
Examining data/centreon-clib-19.10.0/test/logging/temp_logger_do_nothing_string.cc
Examining data/centreon-clib-19.10.0/test/logging/temp_logger_do_nothing_uint.cc
Examining data/centreon-clib-19.10.0/test/logging/temp_logger_do_nothing_ulong.cc
Examining data/centreon-clib-19.10.0/test/logging/temp_logger_do_nothing_ulong_long.cc
Examining data/centreon-clib-19.10.0/test/logging/temp_logger_log_char.cc
Examining data/centreon-clib-19.10.0/test/logging/temp_logger_log_double.cc
Examining data/centreon-clib-19.10.0/test/logging/temp_logger_log_int.cc
Examining data/centreon-clib-19.10.0/test/logging/temp_logger_log_long.cc
Examining data/centreon-clib-19.10.0/test/logging/temp_logger_log_long_long.cc
Examining data/centreon-clib-19.10.0/test/logging/temp_logger_log_pvoid.cc
Examining data/centreon-clib-19.10.0/test/logging/temp_logger_log_std_string.cc
Examining data/centreon-clib-19.10.0/test/logging/temp_logger_log_string.cc
Examining data/centreon-clib-19.10.0/test/logging/temp_logger_log_uint.cc
Examining data/centreon-clib-19.10.0/test/logging/temp_logger_log_ulong.cc
Examining data/centreon-clib-19.10.0/test/logging/temp_logger_log_ulong_long.cc
Examining data/centreon-clib-19.10.0/test/misc/argument_constructor.cc
Examining data/centreon-clib-19.10.0/test/misc/argument_copy.cc
Examining data/centreon-clib-19.10.0/test/misc/argument_equal.cc
Examining data/centreon-clib-19.10.0/test/misc/argument_not_equal.cc
Examining data/centreon-clib-19.10.0/test/misc/argument_set_description.cc
Examining data/centreon-clib-19.10.0/test/misc/argument_set_has_value.cc
Examining data/centreon-clib-19.10.0/test/misc/argument_set_is_set.cc
Examining data/centreon-clib-19.10.0/test/misc/argument_set_long_name.cc
Examining data/centreon-clib-19.10.0/test/misc/argument_set_name.cc
Examining data/centreon-clib-19.10.0/test/misc/argument_set_value.cc
Examining data/centreon-clib-19.10.0/test/misc/command_line_constructor.cc
Examining data/centreon-clib-19.10.0/test/misc/command_line_copy.cc
Examining data/centreon-clib-19.10.0/test/misc/command_line_equal.cc
Examining data/centreon-clib-19.10.0/test/misc/command_line_get_argc.cc
Examining data/centreon-clib-19.10.0/test/misc/command_line_get_argv.cc
Examining data/centreon-clib-19.10.0/test/misc/command_line_not_equal.cc
Examining data/centreon-clib-19.10.0/test/misc/command_line_parse.cc
Examining data/centreon-clib-19.10.0/test/misc/get_options_constructor.cc
Examining data/centreon-clib-19.10.0/test/misc/get_options_constructor_invalid.cc
Examining data/centreon-clib-19.10.0/test/misc/get_options_copy.cc
Examining data/centreon-clib-19.10.0/test/misc/get_options_get_argument_by_long_name.cc
Examining data/centreon-clib-19.10.0/test/misc/get_options_get_argument_by_name.cc
Examining data/centreon-clib-19.10.0/test/misc/stringifier_append.cc
Examining data/centreon-clib-19.10.0/test/misc/stringifier_constructor.cc
Examining data/centreon-clib-19.10.0/test/misc/stringifier_copy.cc
Examining data/centreon-clib-19.10.0/test/misc/stringifier_insert_bool.cc
Examining data/centreon-clib-19.10.0/test/misc/stringifier_insert_char.cc
Examining data/centreon-clib-19.10.0/test/misc/stringifier_insert_double.cc
Examining data/centreon-clib-19.10.0/test/misc/stringifier_insert_int.cc
Examining data/centreon-clib-19.10.0/test/misc/stringifier_insert_long.cc
Examining data/centreon-clib-19.10.0/test/misc/stringifier_insert_longlong.cc
Examining data/centreon-clib-19.10.0/test/misc/stringifier_insert_many_data.cc
Examining data/centreon-clib-19.10.0/test/misc/stringifier_insert_pchar.cc
Examining data/centreon-clib-19.10.0/test/misc/stringifier_insert_pvoid.cc
Examining data/centreon-clib-19.10.0/test/misc/stringifier_insert_std_string.cc
Examining data/centreon-clib-19.10.0/test/misc/stringifier_insert_uint.cc
Examining data/centreon-clib-19.10.0/test/misc/stringifier_insert_ulong.cc
Examining data/centreon-clib-19.10.0/test/misc/stringifier_insert_ulonglong.cc
Examining data/centreon-clib-19.10.0/test/misc/stringifier_reset.cc
Examining data/centreon-clib-19.10.0/test/process_env.cc
Examining data/centreon-clib-19.10.0/test/process_kill.cc
Examining data/centreon-clib-19.10.0/test/process_output.cc
Examining data/centreon-clib-19.10.0/test/process_return.cc
Examining data/centreon-clib-19.10.0/test/process_terminate.cc
Examining data/centreon-clib-19.10.0/test/process_timeout.cc
Examining data/centreon-clib-19.10.0/test/process_wait_timeout.cc
Examining data/centreon-clib-19.10.0/test/shared_testing_library.cc
Examining data/centreon-clib-19.10.0/test/task_manager_add.cc
Examining data/centreon-clib-19.10.0/test/task_manager_add_recurring.cc
Examining data/centreon-clib-19.10.0/test/task_manager_execute.cc
Examining data/centreon-clib-19.10.0/test/task_manager_execute_recurring.cc
Examining data/centreon-clib-19.10.0/test/task_manager_next_execution_time.cc
Examining data/centreon-clib-19.10.0/test/task_manager_remove_by_id.cc
Examining data/centreon-clib-19.10.0/test/task_manager_remove_by_task.cc
Examining data/centreon-clib-19.10.0/test/task_manager_remove_self.cc
Examining data/centreon-clib-19.10.0/test/timestamp_add.cc
Examining data/centreon-clib-19.10.0/test/timestamp_add_mseconds.cc
Examining data/centreon-clib-19.10.0/test/timestamp_add_seconds.cc
Examining data/centreon-clib-19.10.0/test/timestamp_add_useconds.cc
Examining data/centreon-clib-19.10.0/test/timestamp_clear.cc
Examining data/centreon-clib-19.10.0/test/timestamp_constructor.cc
Examining data/centreon-clib-19.10.0/test/timestamp_copy.cc
Examining data/centreon-clib-19.10.0/test/timestamp_equal.cc
Examining data/centreon-clib-19.10.0/test/timestamp_greater.cc
Examining data/centreon-clib-19.10.0/test/timestamp_greater_or_equal.cc
Examining data/centreon-clib-19.10.0/test/timestamp_less.cc
Examining data/centreon-clib-19.10.0/test/timestamp_less_or_equal.cc
Examining data/centreon-clib-19.10.0/test/timestamp_not_equal.cc
Examining data/centreon-clib-19.10.0/test/timestamp_sub.cc
Examining data/centreon-clib-19.10.0/test/timestamp_sub_mseconds.cc
Examining data/centreon-clib-19.10.0/test/timestamp_sub_seconds.cc
Examining data/centreon-clib-19.10.0/test/timestamp_sub_useconds.cc
Examining data/centreon-clib-19.10.0/test/timestamp_to_mseconds.cc
Examining data/centreon-clib-19.10.0/test/timestamp_to_seconds.cc
Examining data/centreon-clib-19.10.0/test/timestamp_to_useconds.cc

FINAL RESULTS:

data/centreon-clib-19.10.0/src/io/file_entry.cc:134:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
  strcpy(path, _path.c_str());
data/centreon-clib-19.10.0/src/io/file_entry.cc:157:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
  strcpy(path, _path.c_str());
data/centreon-clib-19.10.0/src/io/file_stream.cc:103:12:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  return (!access(path, F_OK));
data/centreon-clib-19.10.0/src/misc/stringifier.cc:27:11:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
#  define snprintf _snprintf
data/centreon-clib-19.10.0/src/misc/stringifier.cc:27:20:  [4] (format) _snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
#  define snprintf _snprintf
data/centreon-clib-19.10.0/src/misc/stringifier.cc:295:11:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
  int ret(snprintf(_buffer + _current,
data/centreon-clib-19.10.0/src/misc/stringifier.cc:306:16:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
    if ((ret = snprintf(_buffer + _current,
data/centreon-clib-19.10.0/src/misc/stringifier.cc:331:11:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
  int ret(snprintf(_buffer + _current,
data/centreon-clib-19.10.0/src/misc/stringifier.cc:343:16:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
    if ((ret = snprintf(_buffer + _current,
data/centreon-clib-19.10.0/test/logging/backend_with_thread_id.cc:41:11:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
  int ret(sscanf(
data/centreon-clib-19.10.0/src/concurrency/mutex_win32.cc:36:3:  [3] (misc) InitializeCriticalSection:
  Exceptions can be thrown in low-memory situations. Use
  InitializeCriticalSectionAndSpinCount instead.
  InitializeCriticalSection(&_csection);
data/centreon-clib-19.10.0/src/concurrency/mutex_win32.cc:50:3:  [3] (misc) EnterCriticalSection:
  On some versions of Windows, exceptions can be thrown in low-memory
  situations. Use InitializeCriticalSectionAndSpinCount instead.
  EnterCriticalSection(&_csection);
data/centreon-clib-19.10.0/src/io/file_stream.cc:340:15:  [3] (tmpfile) tmpnam:
  Temporary file race condition (CWE-377).
  char* ret(::tmpnam(static_cast<char*>(NULL)));
data/centreon-clib-19.10.0/src/library_win32.cc:71:19:  [3] (misc) LoadLibrary:
  Ensure that the full path to the library is specified, or current directory
  may be used (CWE-829, CWE-20). Use registry entry or GetWindowsDirectory to
  find library path, if you aren't already.
  if (!(_handle = LoadLibrary(_filename.c_str()))) {
data/centreon-clib-19.10.0/src/process_win32.cc:148:9:  [3] (shell) CreateProcess:
  This causes a new process to execute and is difficult to use safely
  (CWE-78). Specify the application path in the first argument, NOT as part
  of the second, or embedded spaces could allow an attacker to force a
  different program to run.
    if (CreateProcess(
data/centreon-clib-19.10.0/src/process_win32.cc:148:9:  [3] (shell) CreateProcess:
  This causes a new process to execute and is difficult to use safely
  (CWE-78). Specify the application path in the first argument, NOT as part
  of the second, or embedded spaces could allow an attacker to force a
  different program to run.
    if (CreateProcess(
data/centreon-clib-19.10.0/src/handle_listener.cc:44:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buf[4096];
data/centreon-clib-19.10.0/src/io/file_entry.cc:107:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char fname[_MAX_FNAME];
data/centreon-clib-19.10.0/src/io/file_entry.cc:127:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char drive[_MAX_DRIVE];
data/centreon-clib-19.10.0/src/io/file_entry.cc:128:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char dir[_MAX_DIR];
data/centreon-clib-19.10.0/src/io/file_entry.cc:150:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char fname[_MAX_FNAME];
data/centreon-clib-19.10.0/src/io/file_entry.cc:151:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char ext[_MAX_EXT];
data/centreon-clib-19.10.0/src/io/file_stream.cc:160:19:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
void file_stream::open(char const* path, char const* mode) {
data/centreon-clib-19.10.0/src/io/file_stream.cc:168:13:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  _stream = fopen(path, mode);
data/centreon-clib-19.10.0/src/io/file_stream.cc:195:19:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
void file_stream::open(std::string const& path, char const* mode) {
data/centreon-clib-19.10.0/src/io/file_stream.cc:196:3:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  open(path.c_str(), mode);
data/centreon-clib-19.10.0/src/io/file_stream.cc:276:17:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      file_read.open(old_filename, "r");
data/centreon-clib-19.10.0/src/io/file_stream.cc:278:18:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      file_write.open(new_filename, "w");
data/centreon-clib-19.10.0/src/io/file_stream.cc:280:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char data[4096];
data/centreon-clib-19.10.0/src/logging/file.cc:71:3:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  open();
data/centreon-clib-19.10.0/src/logging/file.cc:167:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
void file::open() {
data/centreon-clib-19.10.0/src/logging/file.cc:173:16:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  if (!(_out = fopen(_path.c_str(), "a")))
data/centreon-clib-19.10.0/src/logging/file.cc:195:16:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  if (!(_out = fopen(_path.c_str(), "a")))
data/centreon-clib-19.10.0/src/logging/file.cc:209:3:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  open();
data/centreon-clib-19.10.0/src/logging/syslogger.cc:48:3:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  open();
data/centreon-clib-19.10.0/src/logging/syslogger.cc:94:17:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
void syslogger::open() {
data/centreon-clib-19.10.0/src/misc/command_line.cc:159:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char c(cmdline[i]);
data/centreon-clib-19.10.0/src/misc/command_line.cc:272:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(_argv[0], right._argv[0], _size);
data/centreon-clib-19.10.0/src/misc/stringifier.cc:371:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(_buffer, right._buffer, (_current + 1) * sizeof(*_buffer));
data/centreon-clib-19.10.0/src/misc/stringifier.cc:387:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(new_buffer, _buffer, (_current + 1) * sizeof(*new_buffer));
data/centreon-clib-19.10.0/src/process_manager_posix.cc:316:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buffer[4096];
data/centreon-clib-19.10.0/src/process_manager_win32.cc:180:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buffer[4096];
data/centreon-clib-19.10.0/src/process_posix.cc:490:9:  [2] (race) vfork:
  On some old systems, vfork() permits race conditions, and it's very
  difficult to use correctly (CWE-362). Use fork() instead.
  pid = vfork();
data/centreon-clib-19.10.0/src/process_posix.cc:513:15:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  int newfd(::open("/dev/null", flags));
data/centreon-clib-19.10.0/src/process_win32.cc:147:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(cmd_str.get(), cmd, size);
data/centreon-clib-19.10.0/test/bin_test_process_output.cc:71:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buffer[1024];
data/centreon-clib-19.10.0/test/bin_test_process_output.cc:104:19:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          return (atoi(argv[2]));
data/centreon-clib-19.10.0/test/bin_test_process_output.cc:106:23:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          int timeout(atoi(argv[2]));
data/centreon-clib-19.10.0/test/io/file_entry/pathinfo.cc:37:8:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fs.open(path, "w");
data/centreon-clib-19.10.0/test/io/file_entry/size.cc:41:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      fs.open(temp, "w");
data/centreon-clib-19.10.0/test/io/file_entry/size.cc:52:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      fs.open(temp, "w");
data/centreon-clib-19.10.0/test/io/file_stream/create_exists_remove.cc:51:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      fs.open(path, "w");
data/centreon-clib-19.10.0/test/io/file_stream/read.cc:37:19:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  tmp_file_stream.open(tmp_file_name, "w");
data/centreon-clib-19.10.0/test/io/file_stream/read.cc:58:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buffer[1024];
data/centreon-clib-19.10.0/test/io/file_stream/read.cc:60:21:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    tmp_file_stream.open(tmp_file_name, "r");
data/centreon-clib-19.10.0/test/io/file_stream/rename.cc:45:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      file.open(file_name, "w");
data/centreon-clib-19.10.0/test/io/file_stream/rename.cc:60:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      file.open(new_file_name, "r");
data/centreon-clib-19.10.0/test/io/file_stream/rename.cc:63:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char buffer[64];
data/centreon-clib-19.10.0/test/io/file_stream/write.cc:37:19:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  tmp_file_stream.open(tmp_file_name, "w");
data/centreon-clib-19.10.0/test/logging/backend_with_thread_id.cc:39:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char message[1024];
data/centreon-clib-19.10.0/test/logging/file_log.cc:34:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buffer[1024];
data/centreon-clib-19.10.0/test/logging/file_log.cc:60:19:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      if (!(out = fopen(tmp, "w")))
data/centreon-clib-19.10.0/test/logging/file_log_multiline.cc:37:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buffer[32 * 1024];
data/centreon-clib-19.10.0/test/logging/file_log_multiline.cc:53:11:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    char* tmpfile(com::centreon::io::file_stream::temp_path());
data/centreon-clib-19.10.0/test/logging/file_log_multiline.cc:66:14:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
      file f(tmpfile, false, false, none, true);
data/centreon-clib-19.10.0/test/logging/file_log_multiline.cc:69:28:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    if (!check_log_message(tmpfile, ref))
data/centreon-clib-19.10.0/test/process_output.cc:49:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buffer_write[16 * 1024];
data/centreon-clib-19.10.0/src/concurrency/semaphore_posix.cc:128:5:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
    usleep(100);
data/centreon-clib-19.10.0/src/concurrency/thread_posix.cc:126:14:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
void thread::usleep(unsigned long usecs) {
data/centreon-clib-19.10.0/src/concurrency/thread_posix.cc:186:7:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
      usleep(10000);
data/centreon-clib-19.10.0/src/concurrency/thread_win32.cc:101:14:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
void thread::usleep(unsigned long usecs) {
data/centreon-clib-19.10.0/src/handle_action.cc:108:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  else if (a == read)
data/centreon-clib-19.10.0/src/handle_action.cc:109:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    _hl->read(*_h);
data/centreon-clib-19.10.0/src/handle_listener.cc:42:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
void handle_listener::read(handle& h) {
data/centreon-clib-19.10.0/src/handle_listener.cc:45:5:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  h.read(buf, sizeof(buf));
data/centreon-clib-19.10.0/src/handle_manager_posix.cc:83:39:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      task->set_action(handle_action::read);
data/centreon-clib-19.10.0/src/io/file_stream.cc:207:28:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
unsigned long file_stream::read(void* data, unsigned long size) {
data/centreon-clib-19.10.0/src/io/file_stream.cc:228:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  ssize_t rb(::read(get_native_handle(), data, size));
data/centreon-clib-19.10.0/src/io/file_stream.cc:282:31:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      while ((len = file_read.read(data, sizeof(data))))
data/centreon-clib-19.10.0/src/logging/backend.cc:123:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    static_cast<unsigned int>(strlen(msg)));
data/centreon-clib-19.10.0/src/misc/command_line.cc:146:12:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    size = strlen(cmdline);
data/centreon-clib-19.10.0/src/process_posix.cc:287:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
void process::read(std::string& data) {
data/centreon-clib-19.10.0/src/process_posix.cc:612:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  while ((rb = ::read(fd, data, size)) < 0) {
data/centreon-clib-19.10.0/src/process_win32.cc:145:23:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    unsigned int size(strlen(cmd) + 1);
data/centreon-clib-19.10.0/src/process_win32.cc:236:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
void process::read(std::string& data) {
data/centreon-clib-19.10.0/test/bin_test_process_output.cc:72:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  while ((size = read(0, buffer, sizeof(buffer))) > 0)
data/centreon-clib-19.10.0/test/concurrency/thread_usleep.cc:36:26:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
    concurrency::thread::usleep(waiting);
data/centreon-clib-19.10.0/test/handle_manager_multiplex.cc:52:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  void    read(handle& h) { if (&_ref_h == &h) _is_call = true; }
data/centreon-clib-19.10.0/test/io/file_stream/read.cc:46:36:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        static_cast<unsigned long>(strlen(data))) == 0)
data/centreon-clib-19.10.0/test/io/file_stream/read.cc:51:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      tmp_file_stream.read(NULL, 1);
data/centreon-clib-19.10.0/test/io/file_stream/read.cc:61:32:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    retval |= (tmp_file_stream.read(buffer, sizeof(buffer)) == 0);
data/centreon-clib-19.10.0/test/io/file_stream/rename.cc:64:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      if (file.read(buffer, sizeof(buffer)) != sizeof(data))
data/centreon-clib-19.10.0/test/io/file_stream/write.cc:51:40:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            static_cast<unsigned long>(strlen(data))) == 0);
data/centreon-clib-19.10.0/test/logging/backend_with_pid.cc:39:45:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    static_cast<unsigned int>(data.size() - strlen(msg) - 1 - 3));
data/centreon-clib-19.10.0/test/logging/backend_with_pid.cc:43:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (data.compare(3 + pid_size, strlen(msg), msg))
data/centreon-clib-19.10.0/test/logging/backend_with_thread_id.cc:46:46:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  return (ret == 2 && !strncmp(msg, message, strlen(msg)));
data/centreon-clib-19.10.0/test/logging/backend_with_timestamp.cc:39:45:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    static_cast<unsigned int>(data.size() - strlen(msg) - 1 - 3));
data/centreon-clib-19.10.0/test/logging/backend_with_timestamp.cc:43:35:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (data.compare(3 + time_size, strlen(msg), msg))
data/centreon-clib-19.10.0/test/logging/file_log_multiline.cc:39:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  stream.read(buffer, sizeof(buffer));
data/centreon-clib-19.10.0/test/process_output.cc:61:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        p.read(buffer_read);

ANALYSIS SUMMARY:

Hits = 100
Lines analyzed = 17907 in approximately 0.52 seconds (34612 lines/second)
Physical Source Lines of Code (SLOC) = 8832
Hits@level = [0]   1 [1]  33 [2]  51 [3]   6 [4]  10 [5]   0
Hits@level+ = [0+] 101 [1+] 100 [2+]  67 [3+]  16 [4+]  10 [5+]   0
Hits/KSLOC@level+ = [0+] 11.4357 [1+] 11.3225 [2+] 7.58605 [3+] 1.81159 [4+] 1.13225 [5+]   0
Dot directories skipped = 1 (--followdotdir overrides)
Minimum risk level = 1
Not every hit is necessarily a security vulnerability.
There may be other security vulnerabilities; review your code!
See 'Secure Programming HOWTO'
(https://dwheeler.com/secure-programs) for more information.