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/opari2-2.0.5/include/opari2/pomp2_user_lib.h
Examining data/opari2-2.0.5/include/opari2/pomp2_lib.h
Examining data/opari2-2.0.5/vendor/common/cutest/CuTest.h
Examining data/opari2-2.0.5/vendor/common/cutest/CuTest.c
Examining data/opari2-2.0.5/vendor/common/build-config/generate-library-dependencies-la-object.hpp
Examining data/opari2-2.0.5/vendor/common/build-config/config-common.h
Examining data/opari2-2.0.5/test/data/test6.c
Examining data/opari2-2.0.5/test/data/test2.c
Examining data/opari2-2.0.5/test/data/test4.remove-task.c
Examining data/opari2-2.0.5/test/data/test9.c
Examining data/opari2-2.0.5/test/data/test5.c
Examining data/opari2-2.0.5/test/data/test1.c
Examining data/opari2-2.0.5/test/data/test1.prep.c
Examining data/opari2-2.0.5/test/data/test8.c
Examining data/opari2-2.0.5/test/data/test4.c
Examining data/opari2-2.0.5/test/data/test1_tpd.c
Examining data/opari2-2.0.5/test/data/test7.c
Examining data/opari2-2.0.5/test/data/test3.c
Examining data/opari2-2.0.5/test/data/jacobi/C++/jacobi.h
Examining data/opari2-2.0.5/test/data/jacobi/C++/jacobi.cpp
Examining data/opari2-2.0.5/test/data/jacobi/C++/main.cpp
Examining data/opari2-2.0.5/test/data/jacobi/C/jacobi.h
Examining data/opari2-2.0.5/test/data/jacobi/C/jacobi.c
Examining data/opari2-2.0.5/test/data/jacobi/C/main.c
Examining data/opari2-2.0.5/src/opari/opari2_config.h
Examining data/opari2-2.0.5/src/opari/opari2_config.cc
Examining data/opari2-2.0.5/src/opari/opari2_directive.h
Examining data/opari2-2.0.5/src/opari/opari2_directive.cc
Examining data/opari2-2.0.5/src/opari/opari2_directive_entry.h
Examining data/opari2-2.0.5/src/opari/opari2_directive_definition.h
Examining data/opari2-2.0.5/src/opari/opari2_directive_manager.h
Examining data/opari2-2.0.5/src/opari/opari2_directive_manager.cc
Examining data/opari2-2.0.5/src/opari/opari2_parser_f.cc
Examining data/opari2-2.0.5/src/opari/opari2_parser_f.h
Examining data/opari2-2.0.5/src/opari/opari2_parser_c.cc
Examining data/opari2-2.0.5/src/opari/opari2_parser_c.h
Examining data/opari2-2.0.5/src/opari/opari2.h
Examining data/opari2-2.0.5/src/opari/opari2.cc
Examining data/opari2-2.0.5/src/opari/common.h
Examining data/opari2-2.0.5/src/opari/pomp/opari2_pomp_handler.cc
Examining data/opari2-2.0.5/src/opari/pomp/opari2_pomp_handler.h
Examining data/opari2-2.0.5/src/opari/pomp/opari2_directive_pomp.cc
Examining data/opari2-2.0.5/src/opari/pomp/opari2_directive_pomp.h
Examining data/opari2-2.0.5/src/opari/pomp/opari2_directive_entry_pomp.h
Examining data/opari2-2.0.5/src/opari/openmp/opari2_omp_handler.cc
Examining data/opari2-2.0.5/src/opari/openmp/opari2_omp_handler.h
Examining data/opari2-2.0.5/src/opari/openmp/opari2_directive_openmp.cc
Examining data/opari2-2.0.5/src/opari/openmp/opari2_directive_openmp.h
Examining data/opari2-2.0.5/src/opari/openmp/opari2_directive_entry_openmp.h
Examining data/opari2-2.0.5/src/opari/offload/opari2_offload_handler.h
Examining data/opari2-2.0.5/src/opari/offload/opari2_offload_handler.cc
Examining data/opari2-2.0.5/src/opari/offload/opari2_directive_offload.cc
Examining data/opari2-2.0.5/src/opari/offload/opari2_directive_offload.h
Examining data/opari2-2.0.5/src/opari/offload/opari2_directive_entry_offload.h
Examining data/opari2-2.0.5/src/config-custom.h
Examining data/opari2-2.0.5/src/config.h
Examining data/opari2-2.0.5/src/opari-lib-dummy/foos.c
Examining data/opari2-2.0.5/src/opari-lib-dummy/pomp2_fwrapper_base.h
Examining data/opari2-2.0.5/src/opari-lib-dummy/pomp2_fwrapper_base.c
Examining data/opari2-2.0.5/src/opari-lib-dummy/pomp2_fwrapper.c
Examining data/opari2-2.0.5/src/opari-lib-dummy/pomp2_user_region_info.h
Examining data/opari2-2.0.5/src/opari-lib-dummy/pomp2_user_region_info.c
Examining data/opari2-2.0.5/src/opari-lib-dummy/pomp2_region_info.h
Examining data/opari2-2.0.5/src/opari-lib-dummy/pomp2_region_info.c
Examining data/opari2-2.0.5/src/opari-lib-dummy/opari2_region_info.h
Examining data/opari2-2.0.5/src/opari-lib-dummy/opari2_ctc_parser.h
Examining data/opari2-2.0.5/src/opari-lib-dummy/opari2_ctc_parser.c
Examining data/opari2-2.0.5/src/opari-lib-dummy/opari2_ctc_token.h
Examining data/opari2-2.0.5/src/opari-lib-dummy/pomp2_lib.c
Examining data/opari2-2.0.5/doc/example_user_instrumentation/example_user_instrumentation.c
Examining data/opari2-2.0.5/doc/example/example.c

FINAL RESULTS:

data/opari2-2.0.5/src/opari/opari2_config.cc:289:22:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
    ssize_t result = readlink( "/proc/self/exe", buffer, bufsize );
data/opari2-2.0.5/test/data/test1.prep.c:1308:14:  [5] (buffer) gets:
  Does not check for buffer overflows (CWE-120, CWE-20). Use fgets() instead.
extern char *gets (char *__s) __attribute__ ((__deprecated__));
data/opari2-2.0.5/src/opari-lib-dummy/opari2_ctc_parser.c:174:5:  [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( obj->mCTCStringMemory, source );
data/opari2-2.0.5/src/opari-lib-dummy/opari2_ctc_parser.c:175:5:  [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( obj->mCTCStringForErrorMsg, source );
data/opari2-2.0.5/src/opari-lib-dummy/opari2_ctc_parser.c:375:9:  [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( *filename, token );
data/opari2-2.0.5/src/opari-lib-dummy/opari2_ctc_parser.c:440:5:  [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( *aString, value );
data/opari2-2.0.5/src/opari-lib-dummy/pomp2_lib.c:157:5:  [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( *destination, source );
data/opari2-2.0.5/src/opari/opari2.cc:58:12:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
using std::sprintf;
data/opari2-2.0.5/src/opari/opari2.cc:65:12:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
using std::strcat;
data/opari2-2.0.5/src/opari/opari2.cc:143:10:  [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).
    std::strcpy( &str[ 0 ], constructs.c_str() );
data/opari2-2.0.5/src/opari/opari2.cc:479:30:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
                tmp_inf    = strcat( tmp_inf, argv[ a ] );
data/opari2-2.0.5/test/data/test1.prep.c:1129:12:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
extern int fprintf (FILE *__restrict __stream,
data/opari2-2.0.5/test/data/test1.prep.c:1135:12:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
extern int printf (const char *__restrict __format, ...);
data/opari2-2.0.5/test/data/test1.prep.c:1137:12:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
extern int sprintf (char *__restrict __s,
data/opari2-2.0.5/test/data/test1.prep.c:1144:12:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
extern int vfprintf (FILE *__restrict __s, const char *__restrict __format,
data/opari2-2.0.5/test/data/test1.prep.c:1150:12:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
extern int vprintf (const char *__restrict __format, __gnuc_va_list __arg);
data/opari2-2.0.5/test/data/test1.prep.c:1152:12:  [4] (format) vsprintf:
  Potential format string problem (CWE-134). Make format string constant.
extern int vsprintf (char *__restrict __s, const char *__restrict __format,
data/opari2-2.0.5/test/data/test1.prep.c:1159:12:  [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.
extern int snprintf (char *__restrict __s, size_t __maxlen,
data/opari2-2.0.5/test/data/test1.prep.c:1163:12:  [4] (format) vsnprintf:
  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.
extern int vsnprintf (char *__restrict __s, size_t __maxlen,
data/opari2-2.0.5/test/data/test1.prep.c:1198:12:  [4] (buffer) fscanf:
  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. If the scanf format is influenceable by an
  attacker, it's exploitable.
extern int fscanf (FILE *__restrict __stream,
data/opari2-2.0.5/test/data/test1.prep.c:1204:12:  [4] (buffer) scanf:
  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. If the scanf format is influenceable by an
  attacker, it's exploitable.
extern int scanf (const char *__restrict __format, ...) ;
data/opari2-2.0.5/test/data/test1.prep.c:1206:12:  [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. If the scanf format is influenceable by an
  attacker, it's exploitable.
extern int sscanf (const char *__restrict __s,
data/opari2-2.0.5/test/data/test1.prep.c:1217:12:  [4] (buffer) vfscanf:
  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. If the scanf format is influenceable by an
  attacker, it's exploitable.
extern int vfscanf (FILE *__restrict __s, const char *__restrict __format,
data/opari2-2.0.5/test/data/test1.prep.c:1225:12:  [4] (buffer) vscanf:
  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. If the scanf format is influenceable by an
  attacker, it's exploitable.
extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg)
data/opari2-2.0.5/test/data/test1.prep.c:1229:12:  [4] (buffer) vsscanf:
  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. If the scanf format is influenceable by an
  attacker, it's exploitable.
extern int vsscanf (const char *__restrict __s,
data/opari2-2.0.5/test/data/test1.prep.c:1475:14:  [4] (shell) popen:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
extern FILE *popen (const char *__command, const char *__modes) ;
data/opari2-2.0.5/test/data/test1.prep.c:1493:14:  [4] (misc) cuserid:
  Exactly what cuserid() does is poorly defined (e.g., some systems use the
  effective uid, like Linux, while others like System V use the real uid).
  Thus, you can't trust what it does. It's certainly not portable (The
  cuserid function was included in the 1988 version of POSIX, but removed
  from the 1990 version). Also, if passed a non-null parameter, there's a
  risk of a buffer overflow if the passed-in buffer is not at least L_cuserid
  characters long (CWE-120). Use getpwuid(geteuid()) and extract the desired
  information instead.
extern char *cuserid (char *__s);
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:33:5:  [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( newStr, old );
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:107:5:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
    strcat( str->buffer, text );
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:137:5:  [4] (format) vsprintf:
  Potential format string problem (CWE-134). Make format string constant.
    vsprintf( buf, format, argp );
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:232:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf( buf, "%s:%d: ", file, line );
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:456:23:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
              || 0 == system( "test -t 1" ) ) )
data/opari2-2.0.5/test/data/jacobi/C++/main.cpp:42:24:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    char* env        = getenv( "ITERATIONS" );
data/opari2-2.0.5/test/data/jacobi/C/main.c:43:24:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    char* env        = getenv( "ITERATIONS" );
data/opari2-2.0.5/test/data/test1.prep.c:1020:14:  [3] (tmpfile) tmpnam:
  Temporary file race condition (CWE-377).
extern char *tmpnam (char *__s) throw () ;
data/opari2-2.0.5/test/data/test1.prep.c:1028:14:  [3] (tmpfile) tempnam:
  Temporary file race condition (CWE-377).
extern char *tempnam (const char *__dir, const char *__pfx)
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:449:23:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    if ( 0 != strcmp( getenv( "AM_COLOR_TESTS" ) ? getenv( "AM_COLOR_TESTS" ) : "", "no" )
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:449:52:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    if ( 0 != strcmp( getenv( "AM_COLOR_TESTS" ) ? getenv( "AM_COLOR_TESTS" ) : "", "no" )
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:450:26:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
         && 0 != strcmp( getenv( "TERM" ) ? getenv( "TERM" ) : "", "dumb" )
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:450:45:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
         && 0 != strcmp( getenv( "TERM" ) ? getenv( "TERM" ) : "", "dumb" )
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:451:17:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
         && ( ( getenv( "AM_COLOR_TESTS" )
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:452:33:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
                && 0 == strcmp( getenv( "AM_COLOR_TESTS" ), "always" ) )
data/opari2-2.0.5/src/opari-lib-dummy/foos.c:240:15:  [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).
    FILE* f = fopen( "pomp2_fwrapper_def.h", "w" );
data/opari2-2.0.5/src/opari-lib-dummy/opari2_ctc_parser.c:381:20:  [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).
        line1Tmp = atoi( token );
data/opari2-2.0.5/src/opari-lib-dummy/opari2_ctc_parser.c:386:20:  [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).
        line2Tmp = atoi( token );
data/opari2-2.0.5/src/opari-lib-dummy/opari2_ctc_parser.c:414:15:  [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 tmp = atoi( value );
data/opari2-2.0.5/src/opari-lib-dummy/opari2_ctc_parser.c:427:15:  [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 tmp = atoi( value );
data/opari2-2.0.5/src/opari/opari2.cc:142: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 str[ constructs.length() + 1 ];
data/opari2-2.0.5/src/opari/opari2.cc:449:24:  [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).
                opt.os.open( argv[ a + 1 ] );
data/opari2-2.0.5/src/opari/opari2.cc:487:20:  [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).
            opt.is.open( opt.infile.c_str() );
data/opari2-2.0.5/src/opari/opari2.cc:572:20:  [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).
            opt.os.open( opt.outfile.c_str() );
data/opari2-2.0.5/src/opari/opari2_config.cc:287: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[ bufsize ];
data/opari2-2.0.5/src/opari/opari2_config.cc:308: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).
    inFile.open( config_file.c_str(), std::ios_base::in );
data/opari2-2.0.5/src/opari/opari2_config.cc:318:9:  [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 line[ 512 ] = { "" };
data/opari2-2.0.5/src/opari/opari2_parser_c.cc:327:20:  [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).
        m_lineno = atoi( m_line.substr( nrstart, nrend ).c_str() ) - 1;
data/opari2-2.0.5/src/opari/opari2_parser_c.cc:356:20:  [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).
        m_lineno = atoi( m_line.substr( nrstart, nrend ).c_str() ) - 1;
data/opari2-2.0.5/src/opari/opari2_parser_f.cc:693:20:  [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).
        m_lineno = atoi( m_line.substr( nrstart, nrend ).c_str() ) - 1;
data/opari2-2.0.5/src/opari/opari2_parser_f.cc:722:20:  [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).
        m_lineno = atoi( m_line.substr( nrstart, nrend ).c_str() ) - 1;
data/opari2-2.0.5/test/data/jacobi/C++/main.cpp:45:26:  [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 iterations = atoi( env );
data/opari2-2.0.5/test/data/jacobi/C/main.c:46:26:  [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 iterations = atoi( env );
data/opari2-2.0.5/test/data/test1.prep.c:100:12:  [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.
  unsigned char _x[4]
data/opari2-2.0.5/test/data/test1.prep.c:106:12:  [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.
  unsigned char _x[16]
data/opari2-2.0.5/test/data/test1.prep.c:750: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 __wchb[4];
data/opari2-2.0.5/test/data/test1.prep.c:833: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 _shortbuf[1];
data/opari2-2.0.5/test/data/test1.prep.c:849: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 _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
data/opari2-2.0.5/test/data/test1.prep.c:1014:14:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
extern FILE *tmpfile (void) ;
data/opari2-2.0.5/test/data/test1.prep.c:1058:14:  [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).
extern FILE *fopen (const char *__restrict __filename,
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:114: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 text[ 2 ];
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:136: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 buf[ HUGE_STRING_LEN ];
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:157: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( str->buffer + pos, text, length );
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:230: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 buf[ HUGE_STRING_LEN ];
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:330: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 buf[ STRING_MAX ];
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:346:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf( buf, "expected <%d> but was <%d>", expected, actual );
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:359: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 buf[ STRING_MAX ];
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:375:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf( buf, "Not expected <%d> but was <%d>", notExpected, actual );
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:388: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 buf[ STRING_MAX ];
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:404:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf( buf, "expected <%lf> but was <%lf>", expected, actual );
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:416: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 buf[ STRING_MAX ];
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:432:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf( buf, "expected pointer <%p> but was <%p>", expected, actual );
data/opari2-2.0.5/src/opari-lib-dummy/opari2_ctc_parser.c:171:27:  [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).
    const size_t nBytes = strlen( source ) * sizeof( char ) + 1;
data/opari2-2.0.5/src/opari-lib-dummy/opari2_ctc_parser.c:319:10:  [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 ( strlen( *key ) == 0 )
data/opari2-2.0.5/src/opari-lib-dummy/opari2_ctc_parser.c:329:10:  [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 ( strlen( *value ) == 0 )
data/opari2-2.0.5/src/opari-lib-dummy/opari2_ctc_parser.c:374:29:  [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).
        *filename = malloc( strlen( token ) * sizeof( char ) + 1 );
data/opari2-2.0.5/src/opari-lib-dummy/opari2_ctc_parser.c:439:24:  [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).
    *aString = malloc( strlen( value ) * sizeof( char ) + 1 );
data/opari2-2.0.5/src/opari-lib-dummy/pomp2_fwrapper.c:264:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(str,ctc_string,ctc_string_len);
data/opari2-2.0.5/src/opari-lib-dummy/pomp2_fwrapper.c:273:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(str,ctc_string,ctc_string_len);
data/opari2-2.0.5/src/opari-lib-dummy/pomp2_lib.c:156:28:  [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).
    *destination = malloc( strlen( source ) * sizeof( char ) + 1 );
data/opari2-2.0.5/src/opari/opari2.cc:64:12:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
using std::strncpy;
data/opari2-2.0.5/src/opari/opari2.cc:66: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).
using std::strlen;
data/opari2-2.0.5/src/opari/opari2.cc:470: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).
                pathlength += strlen( argv[ a ] ) + 1;
data/opari2-2.0.5/src/opari/opari2.cc:478:30:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
                tmp_inf    = strcat( tmp_inf, "/" );
data/opari2-2.0.5/src/opari/opari2_parser_f.cc:62: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).
using std::strlen;
data/opari2-2.0.5/test/data/test1.prep.c:896:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  __io_read_fn *read;
data/opari2-2.0.5/test/data/test1.prep.c:1242:12:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
extern int fgetc (FILE *__stream);
data/opari2-2.0.5/test/data/test1.prep.c:1243:12:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
extern int getc (FILE *__stream);
data/opari2-2.0.5/test/data/test1.prep.c:1249:12:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
extern int getchar (void);
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:31:20:  [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).
    int   len    = strlen( old );
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:101:14:  [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).
    length = strlen( text );
data/opari2-2.0.5/vendor/common/cutest/CuTest.c:146:18:  [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).
    int length = strlen( text );

ANALYSIS SUMMARY:

Hits = 99
Lines analyzed = 20447 in approximately 0.48 seconds (42377 lines/second)
Physical Source Lines of Code (SLOC) = 13468
Hits@level = [0] 192 [1]  20 [2]  37 [3]  10 [4]  30 [5]   2
Hits@level+ = [0+] 291 [1+]  99 [2+]  79 [3+]  42 [4+]  32 [5+]   2
Hits/KSLOC@level+ = [0+] 21.6068 [1+] 7.35076 [2+] 5.86576 [3+] 3.1185 [4+] 2.376 [5+] 0.1485
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.