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/libhtp-0.5.35/examples/mod_libhtp/mod_libhtp.c
Examining data/libhtp-0.5.35/extras/htptest.c
Examining data/libhtp-0.5.35/extras/ruby/HTP.c
Examining data/libhtp-0.5.35/htp/bstr.c
Examining data/libhtp-0.5.35/htp/bstr.h
Examining data/libhtp-0.5.35/htp/bstr_builder.c
Examining data/libhtp-0.5.35/htp/bstr_builder.h
Examining data/libhtp-0.5.35/htp/htp.h
Examining data/libhtp-0.5.35/htp/htp_base64.c
Examining data/libhtp-0.5.35/htp/htp_base64.h
Examining data/libhtp-0.5.35/htp/htp_config.c
Examining data/libhtp-0.5.35/htp/htp_config.h
Examining data/libhtp-0.5.35/htp/htp_config_auto.h
Examining data/libhtp-0.5.35/htp/htp_config_private.h
Examining data/libhtp-0.5.35/htp/htp_connection.c
Examining data/libhtp-0.5.35/htp/htp_connection_parser.c
Examining data/libhtp-0.5.35/htp/htp_connection_parser.h
Examining data/libhtp-0.5.35/htp/htp_connection_parser_private.h
Examining data/libhtp-0.5.35/htp/htp_connection_private.h
Examining data/libhtp-0.5.35/htp/htp_content_handlers.c
Examining data/libhtp-0.5.35/htp/htp_cookies.c
Examining data/libhtp-0.5.35/htp/htp_core.h
Examining data/libhtp-0.5.35/htp/htp_decompressors.c
Examining data/libhtp-0.5.35/htp/htp_decompressors.h
Examining data/libhtp-0.5.35/htp/htp_hooks.c
Examining data/libhtp-0.5.35/htp/htp_hooks.h
Examining data/libhtp-0.5.35/htp/htp_list.c
Examining data/libhtp-0.5.35/htp/htp_list.h
Examining data/libhtp-0.5.35/htp/htp_list_private.h
Examining data/libhtp-0.5.35/htp/htp_multipart.c
Examining data/libhtp-0.5.35/htp/htp_multipart.h
Examining data/libhtp-0.5.35/htp/htp_multipart_private.h
Examining data/libhtp-0.5.35/htp/htp_parsers.c
Examining data/libhtp-0.5.35/htp/htp_php.c
Examining data/libhtp-0.5.35/htp/htp_private.h
Examining data/libhtp-0.5.35/htp/htp_request.c
Examining data/libhtp-0.5.35/htp/htp_request_apache_2_2.c
Examining data/libhtp-0.5.35/htp/htp_request_generic.c
Examining data/libhtp-0.5.35/htp/htp_request_parsers.c
Examining data/libhtp-0.5.35/htp/htp_response.c
Examining data/libhtp-0.5.35/htp/htp_response_generic.c
Examining data/libhtp-0.5.35/htp/htp_table.c
Examining data/libhtp-0.5.35/htp/htp_table.h
Examining data/libhtp-0.5.35/htp/htp_table_private.h
Examining data/libhtp-0.5.35/htp/htp_transaction.c
Examining data/libhtp-0.5.35/htp/htp_transaction.h
Examining data/libhtp-0.5.35/htp/htp_transcoder.c
Examining data/libhtp-0.5.35/htp/htp_urlencoded.c
Examining data/libhtp-0.5.35/htp/htp_urlencoded.h
Examining data/libhtp-0.5.35/htp/htp_utf8_decoder.c
Examining data/libhtp-0.5.35/htp/htp_utf8_decoder.h
Examining data/libhtp-0.5.35/htp/htp_util.c
Examining data/libhtp-0.5.35/htp/lzma/7zTypes.h
Examining data/libhtp-0.5.35/htp/lzma/Compiler.h
Examining data/libhtp-0.5.35/htp/lzma/LzFind.c
Examining data/libhtp-0.5.35/htp/lzma/LzFind.h
Examining data/libhtp-0.5.35/htp/lzma/LzHash.h
Examining data/libhtp-0.5.35/htp/lzma/LzmaDec.c
Examining data/libhtp-0.5.35/htp/lzma/LzmaDec.h
Examining data/libhtp-0.5.35/htp/lzma/Precomp.h
Examining data/libhtp-0.5.35/htp/strlcat.c
Examining data/libhtp-0.5.35/htp/strlcpy.c
Examining data/libhtp-0.5.35/test/fuzz/fuzz_htp.c
Examining data/libhtp-0.5.35/test/fuzz/fuzz_htp.h
Examining data/libhtp-0.5.35/test/fuzz/onefile.c
Examining data/libhtp-0.5.35/test/gtest/gtest-all.cc
Examining data/libhtp-0.5.35/test/gtest/gtest.h
Examining data/libhtp-0.5.35/test/gtest/gtest_main.cc
Examining data/libhtp-0.5.35/test/main.c
Examining data/libhtp-0.5.35/test/test-tcpick.c
Examining data/libhtp-0.5.35/test/test.c
Examining data/libhtp-0.5.35/test/test.h
Examining data/libhtp-0.5.35/test/test_bench.cpp
Examining data/libhtp-0.5.35/test/test_bstr.cpp
Examining data/libhtp-0.5.35/test/test_gunzip.cpp
Examining data/libhtp-0.5.35/test/test_hybrid.cpp
Examining data/libhtp-0.5.35/test/test_main.cpp
Examining data/libhtp-0.5.35/test/test_multipart.cpp
Examining data/libhtp-0.5.35/test/test_utils.cpp

FINAL RESULTS:

data/libhtp-0.5.35/htp/htp_response.c:517:5:  [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.
    fprintf(stderr, "bytes_to_consume %"PRIuMAX, (uintmax_t)bytes_to_consume);
data/libhtp-0.5.35/htp/htp_transaction.c:1160:5:  [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.
    fprintf(stderr, "INPUT %"PRIuMAX, (uintmax_t)in_len);
data/libhtp-0.5.35/htp/htp_transaction.c:1188:5:  [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.
    fprintf(stderr, "INPUT (POST SEP STRIP) %"PRIuMAX, (uintmax_t)in_len);
data/libhtp-0.5.35/htp/htp_transaction.c:1292:13:  [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.
            fprintf(stderr, "INPUT %"PRIuMAX, (uintmax_t)input_len);
data/libhtp-0.5.35/htp/htp_transaction.c:1300:17:  [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.
                fprintf(stderr, "TOKEN %"PRIuMAX, (uintmax_t)tok_len);
data/libhtp-0.5.35/htp/htp_util.c:404:13:  [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.
    int r = vsnprintf(buf, 1024, fmt, args);
data/libhtp-0.5.35/htp/htp_util.c:1999:9:  [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.
        snprintf(buf, sizeof(buf), "%x" PRIx64, (unsigned int) offset);
data/libhtp-0.5.35/test/gtest/gtest-all.cc:1440:10:  [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.
# define vsnprintf _vsnprintf
data/libhtp-0.5.35/test/gtest/gtest-all.cc:2144:12:  [4] (buffer) StrNCpy:
  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).
    posix::StrNCpy(clone, str, length);
data/libhtp-0.5.35/test/gtest/gtest-all.cc:2764:12:  [4] (buffer) StrNCpy:
  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).
    posix::StrNCpy(
data/libhtp-0.5.35/test/gtest/gtest-all.cc:3017:20:  [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.
  const int size = vsnprintf(buffer, kBufferSize, format, args);
data/libhtp-0.5.35/test/gtest/gtest-all.cc:3021:20:  [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.
  const int size = vsnprintf(buffer, kBufferSize, format, args);
data/libhtp-0.5.35/test/gtest/gtest-all.cc:3938:5:  [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.
    vprintf(fmt, args);
data/libhtp-0.5.35/test/gtest/gtest-all.cc:3957:3:  [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.
  vprintf(fmt, args);
data/libhtp-0.5.35/test/gtest/gtest-all.cc:3964:3:  [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.
  vprintf(fmt, args);
data/libhtp-0.5.35/test/gtest/gtest-all.cc:8605:10:  [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/libhtp-0.5.35/test/gtest/gtest-all.cc:8605:19:  [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/libhtp-0.5.35/test/gtest/gtest-all.cc:8607:10:  [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_s
data/libhtp-0.5.35/test/gtest/gtest-all.cc:8609:10:  [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/libhtp-0.5.35/test/gtest/gtest-all.cc:8609:19:  [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/libhtp-0.5.35/test/gtest/gtest.h:2671:20:  [4] (buffer) StrNCpy:
  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).
inline const char* StrNCpy(char* dest, const char* src, size_t n) {
data/libhtp-0.5.35/test/gtest/gtest.h:8110:5:  [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.
    fprintf(\
data/libhtp-0.5.35/test/gtest/gtest-all.cc:700:37:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
void ShuffleRange(internal::Random* random, int begin, int end,
data/libhtp-0.5.35/test/gtest/gtest-all.cc:721:39:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
inline void Shuffle(internal::Random* random, std::vector<E>* v) {
data/libhtp-0.5.35/test/gtest/gtest-all.cc:722:16:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  ShuffleRange(random, 0, static_cast<int>(v->size()), v);
data/libhtp-0.5.35/test/gtest/gtest-all.cc:1172:21:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  internal::Random* random() { return &random_; }
data/libhtp-0.5.35/test/gtest/gtest-all.cc:3767:47:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
void TestCase::ShuffleTests(internal::Random* random) {
data/libhtp-0.5.35/test/gtest/gtest-all.cc:3768:11:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  Shuffle(random, &test_indices_);
data/libhtp-0.5.35/test/gtest/gtest-all.cc:5519:7:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
      random()->Reseed(random_seed_);
data/libhtp-0.5.35/test/gtest/gtest-all.cc:5790:16:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  ShuffleRange(random(), 0, last_death_test_case_ + 1, &test_case_indices_);
data/libhtp-0.5.35/test/gtest/gtest-all.cc:5793:16:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  ShuffleRange(random(), last_death_test_case_ + 1,
data/libhtp-0.5.35/test/gtest/gtest-all.cc:5798:34:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
    test_cases_[i]->ShuffleTests(random());
data/libhtp-0.5.35/test/gtest/gtest.h:2709:27:  [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.
  const char* const env = getenv(name);
data/libhtp-0.5.35/test/gtest/gtest.h:2712:10:  [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.
  return getenv(name);
data/libhtp-0.5.35/test/gtest/gtest.h:17891:39:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  void ShuffleTests(internal::Random* random);
data/libhtp-0.5.35/test/test_bench.cpp:49:16:  [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.
        home = getenv("srcdir");
data/libhtp-0.5.35/test/test_gunzip.cpp:114:16:  [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.
        home = getenv("srcdir");
data/libhtp-0.5.35/test/test_main.cpp:49:16:  [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.
        home = getenv("srcdir");
data/libhtp-0.5.35/extras/htptest.c:243:21:  [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(chunk->data, hlf->data + htp_connp_req_data_consumed(sd->connp), chunk->len);
data/libhtp-0.5.35/extras/htptest.c:265:17:  [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(chunk->data, hlf->data, chunk->len);
data/libhtp-0.5.35/extras/htptest.c:286:21:  [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(chunk->data, hlf->data + htp_connp_res_data_consumed(sd->connp), chunk->len);
data/libhtp-0.5.35/extras/htptest.c:307:17:  [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(chunk->data, hlf->data, chunk->len);
data/libhtp-0.5.35/extras/htptest.c:413:13:  [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(chunk->data, hlf->data, chunk->len);
data/libhtp-0.5.35/extras/htptest.c:479: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 filename[256];        
data/libhtp-0.5.35/extras/htptest.c:484: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).
        sd->fd = open(filename, O_CREAT | O_TRUNC | O_RDWR, S_IRUSR | S_IWUSR);
data/libhtp-0.5.35/htp/bstr.c:75: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(bstr_ptr(destination) + bstr_len(b), data, len);
data/libhtp-0.5.35/htp/bstr.c:92: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(bstr_ptr(destination) + bstr_len(b), data, copylen);
data/libhtp-0.5.35/htp/bstr.c:249: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(bstr_ptr(bnew), bstr_ptr(b) + offset, len);
data/libhtp-0.5.35/htp/bstr.c:261: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(bstr_ptr(bnew), data, len);
data/libhtp-0.5.35/htp/htp_config.c:190: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(copy, cfg, sizeof (htp_cfg_t));
data/libhtp-0.5.35/htp/htp_connection.c:69:9:  [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(&(conn->close_timestamp), timestamp, sizeof(htp_time_t));
data/libhtp-0.5.35/htp/htp_connection.c:142:9:  [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(&(conn->open_timestamp), timestamp, sizeof(*timestamp));
data/libhtp-0.5.35/htp/htp_decompressors.c:275:17:  [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(drec->header + drec->header_len, drec->stream.next_in, consumed);
data/libhtp-0.5.35/htp/htp_list.c:155:13:  [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(newblock,
data/libhtp-0.5.35/htp/htp_list.c:160:13:  [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((void *) ((char *) newblock + (l->max_size - l->first) * sizeof (void *)),
data/libhtp-0.5.35/htp/htp_multipart.c:676:25:  [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[255];
data/libhtp-0.5.35/htp/htp_multipart.c:688:42:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
                        part->file->fd = mkstemp(part->file->tmpname);
data/libhtp-0.5.35/htp/htp_request.c:221:9:  [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(connp->in_buf, data, len);
data/libhtp-0.5.35/htp/htp_request.c:228:9:  [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(connp->in_buf + connp->in_buf_size, data, len);
data/libhtp-0.5.35/htp/htp_request.c:1017:9:  [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(&connp->in_timestamp, timestamp, sizeof (*timestamp));
data/libhtp-0.5.35/htp/htp_response.c:222:9:  [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(connp->out_buf, data, len);
data/libhtp-0.5.35/htp/htp_response.c:229:9:  [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(connp->out_buf + connp->out_buf_size, data, len);
data/libhtp-0.5.35/htp/htp_response.c:1274:9:  [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(&connp->out_timestamp, timestamp, sizeof (*timestamp));
data/libhtp-0.5.35/htp/htp_util.c:394: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[1024];
data/libhtp-0.5.35/htp/htp_util.c:1991: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[160];
data/libhtp-0.5.35/htp/htp_util.c:2005:17:  [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 step[4];
data/libhtp-0.5.35/htp/htp_util.c:2020:17:  [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 step[4];
data/libhtp-0.5.35/htp/lzma/LzmaDec.c:965:13:  [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(p->tempBuf, src, inSize);
data/libhtp-0.5.35/htp/lzma/LzmaDec.c:1085: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(dest, p->dic + dicPos, outSizeCur);
data/libhtp-0.5.35/test/fuzz/fuzz_htp.c:125: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).
    logfile = fopen(name, "w");
data/libhtp-0.5.35/test/fuzz/fuzz_htp.c:136: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).
        logfile = fopen("/dev/null", "w");
data/libhtp-0.5.35/test/fuzz/onefile.c:18:10:  [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).
    fp = fopen(argv[1], "rb");
data/libhtp-0.5.35/test/gtest/gtest-all.cc:2167:7:  [2] (buffer) MultiByteToWideChar:
  Requires maximum length in CHARACTERS, not bytes (CWE-120).
      MultiByteToWideChar(CP_ACP, 0, ansi, length,
data/libhtp-0.5.35/test/gtest/gtest-all.cc:2170:3:  [2] (buffer) MultiByteToWideChar:
  Requires maximum length in CHARACTERS, not bytes (CWE-120).
  MultiByteToWideChar(CP_ACP, 0, ansi, length,
data/libhtp-0.5.35/test/gtest/gtest-all.cc:2658: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 error_text[kBufSize] = { '\0' };
data/libhtp-0.5.35/test/gtest/gtest-all.cc:2826: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[32];  // CodePointToUtf8 requires a buffer this big.
data/libhtp-0.5.35/test/gtest/gtest-all.cc:3008: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[4096];
data/libhtp-0.5.35/test/gtest/gtest-all.cc:6471: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[256];
data/libhtp-0.5.35/test/gtest/gtest-all.cc:6890: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 executable_path[_MAX_PATH + 1];  // NOLINT
data/libhtp-0.5.35/test/gtest/gtest-all.cc:7534: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 cwd[GTEST_PATH_MAX_ + 1] = { '\0' };
data/libhtp-0.5.35/test/gtest/gtest-all.cc:7537: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 cwd[GTEST_PATH_MAX_ + 1] = { '\0' };
data/libhtp-0.5.35/test/gtest/gtest-all.cc:8218:3:  [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, regex, len);
data/libhtp-0.5.35/test/gtest/gtest-all.cc:8296: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 temp_dir_path[MAX_PATH + 1] = { '\0' };  // NOLINT
data/libhtp-0.5.35/test/gtest/gtest-all.cc:8297: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 temp_file_path[MAX_PATH + 1] = { '\0' };  // NOLINT
data/libhtp-0.5.35/test/gtest/gtest-all.cc:8315:29:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
    const int captured_fd = mkstemp(name_template);
data/libhtp-0.5.35/test/gtest/gtest-all.cc:8615: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 text[5] = "";
data/libhtp-0.5.35/test/gtest/gtest.h:2683:10:  [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).
  return fopen(path, mode);
data/libhtp-0.5.35/test/gtest/gtest.h:3154: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, a_length);
data/libhtp-0.5.35/test/main.c:134: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[256];
data/libhtp-0.5.35/test/main.c:162: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[1025];
data/libhtp-0.5.35/test/test-tcpick.c:109: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[1025];
data/libhtp-0.5.35/test/test-tcpick.c:125: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(filename, "rb");
data/libhtp-0.5.35/test/test-tcpick.c:260: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[256];
data/libhtp-0.5.35/test/test-tcpick.c:325: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[1025];
data/libhtp-0.5.35/test/test.c:115:14:  [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 fd = open(filename, O_RDONLY | O_BINARY);
data/libhtp-0.5.35/test/test.c:147:9:  [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(test->buf + i * buf.st_size + i, test->buf, buf.st_size);
data/libhtp-0.5.35/test/test.c:256:32:  [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).
                *remote_port = atoi(p);
data/libhtp-0.5.35/test/test.c:262:31:  [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).
                *local_port = atoi(p);
data/libhtp-0.5.35/test/test.c:283: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 filename[1025];
data/libhtp-0.5.35/test/test_gunzip.cpp:67: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 filename[1025];
data/libhtp-0.5.35/test/test_gunzip.cpp:74: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).
        int fd = open(filename, O_RDONLY | O_BINARY);
data/libhtp-0.5.35/test/test_main.cpp:1175:18:  [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 *null = fopen("/dev/null", "w");
data/libhtp-0.5.35/test/test_main.cpp:1188: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 long_message[1300];
data/libhtp-0.5.35/test/test_multipart.cpp:68: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 buf[32];
data/libhtp-0.5.35/test/test_multipart.cpp:211: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 *parts[999];
data/libhtp-0.5.35/test/test_multipart.cpp:964:14:  [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 fd = open(part->file->tmpname, O_RDONLY | O_BINARY);
data/libhtp-0.5.35/test/test_multipart.cpp:971: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[7];
data/libhtp-0.5.35/test/test_utils.cpp:107: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 data[100];
data/libhtp-0.5.35/test/test_utils.cpp:111:5:  [2] (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). Risk is low because the source is a constant string.
    strcpy(data, "test\r\n");
data/libhtp-0.5.35/test/test_utils.cpp:117:5:  [2] (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). Risk is low because the source is a constant string.
    strcpy(data, "test\r\n\n");
data/libhtp-0.5.35/test/test_utils.cpp:123:5:  [2] (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). Risk is low because the source is a constant string.
    strcpy(data, "test\r\n\r\n");
data/libhtp-0.5.35/test/test_utils.cpp:129:5:  [2] (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). Risk is low because the source is a constant string.
    strcpy(data, "te\nst");
data/libhtp-0.5.35/test/test_utils.cpp:135:5:  [2] (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). Risk is low because the source is a constant string.
    strcpy(data, "foo\n");
data/libhtp-0.5.35/test/test_utils.cpp:141:5:  [2] (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). Risk is low because the source is a constant string.
    strcpy(data, "arfarf");
data/libhtp-0.5.35/test/test_utils.cpp:173: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 data[100];
data/libhtp-0.5.35/test/test_utils.cpp:174:5:  [2] (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). Risk is low because the source is a constant string.
    strcpy(data, "arfarf");
data/libhtp-0.5.35/test/test_utils.cpp:177:5:  [2] (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). Risk is low because the source is a constant string.
    strcpy(data, "\r\n");
data/libhtp-0.5.35/test/test_utils.cpp:186: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 data[100];
data/libhtp-0.5.35/test/test_utils.cpp:187:5:  [2] (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). Risk is low because the source is a constant string.
    strcpy(data, "arfarf");
data/libhtp-0.5.35/test/test_utils.cpp:190:5:  [2] (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). Risk is low because the source is a constant string.
    strcpy(data, "\r\n");
data/libhtp-0.5.35/htp/bstr.c:59:48:  [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 bstr_add_mem(bdestination, csource, strlen(csource));
data/libhtp-0.5.35/htp/bstr.c:63:51:  [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 bstr_add_mem_noex(destination, source, strlen(source));
data/libhtp-0.5.35/htp/bstr.c:119:51:  [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 bstr_begins_with_mem(haystack, needle, strlen(needle));
data/libhtp-0.5.35/htp/bstr.c:123:58:  [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 bstr_begins_with_mem_nocase(haystack, needle, strlen(needle));
data/libhtp-0.5.35/htp/bstr.c:215:59:  [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 bstr_util_cmp_mem(bstr_ptr(b), bstr_len(b), c, strlen(c));
data/libhtp-0.5.35/htp/bstr.c:219:66:  [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 bstr_util_cmp_mem_nocase(bstr_ptr(b), bstr_len(b), c, strlen(c));
data/libhtp-0.5.35/htp/bstr.c:223:73:  [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 bstr_util_cmp_mem_nocasenorzero(bstr_ptr(b), bstr_len(b), c, strlen(c));
data/libhtp-0.5.35/htp/bstr.c:243: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).
    return bstr_dup_mem(cstr, strlen(cstr));
data/libhtp-0.5.35/htp/bstr.c:295:48:  [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 bstr_index_of_mem(haystack, needle, strlen(needle));
data/libhtp-0.5.35/htp/bstr.c:299:55:  [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 bstr_index_of_mem_nocase(haystack, needle, strlen(needle));
data/libhtp-0.5.35/htp/bstr.c:303:101:  [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 bstr_util_mem_index_of_mem_nocasenorzero(bstr_ptr(haystack), bstr_len(haystack), needle, strlen(needle));
data/libhtp-0.5.35/htp/bstr.c:486:59:  [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 bstr_util_mem_index_of_mem(_data1, len1, cstr, strlen(cstr));
data/libhtp-0.5.35/htp/bstr.c:490:66:  [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 bstr_util_mem_index_of_mem_nocase(_data1, len1, cstr, strlen(cstr));
data/libhtp-0.5.35/htp/bstr.c:627:50:  [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 bstr_wrap_mem((unsigned char *) cstr, strlen(cstr));
data/libhtp-0.5.35/htp/htp_multipart.c:678:25:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                        strncpy(buf, part->parser->extract_dir, 254);
data/libhtp-0.5.35/htp/htp_multipart.c:679:25:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings. Risk is low because the source is a
  constant string.
                        strncat(buf, "/libhtp-multipart-file-XXXXXX", 254 - strlen(buf));
data/libhtp-0.5.35/htp/htp_multipart.c:679:77:  [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).
                        strncat(buf, "/libhtp-multipart-file-XXXXXX", 254 - strlen(buf));
data/libhtp-0.5.35/htp/htp_multipart.c:687:48:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
                        mode_t previous_mask = umask(S_IXUSR | S_IRWXG | S_IRWXO);
data/libhtp-0.5.35/htp/htp_multipart.c:689:25:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
                        umask(previous_mask);
data/libhtp-0.5.35/htp/htp_util.c:2033:25:  [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).
        char *p = buf + strlen(buf);
data/libhtp-0.5.35/htp/strlcat.c:64: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).
        return(dlen + strlen(s));
data/libhtp-0.5.35/test/gtest/gtest-all.cc:2155:47:  [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).
                    NULL : CloneString(c_str, strlen(c_str));
data/libhtp-0.5.35/test/gtest/gtest-all.cc:2165:22:  [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 int length = strlen(ansi);
data/libhtp-0.5.35/test/gtest/gtest-all.cc:2810:34:  [1] (buffer) wcslen:
  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).
    num_chars = static_cast<int>(wcslen(str));
data/libhtp-0.5.35/test/gtest/gtest-all.cc:2975: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 this_len = strlen(c_str());
data/libhtp-0.5.35/test/gtest/gtest-all.cc:2976: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).
  const size_t suffix_len = strlen(suffix);
data/libhtp-0.5.35/test/gtest/gtest-all.cc:2988: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 this_len = strlen(c_str());
data/libhtp-0.5.35/test/gtest/gtest-all.cc:2989: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).
  const size_t suffix_len = strlen(suffix);
data/libhtp-0.5.35/test/gtest/gtest-all.cc:4517:32:  [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).
      segment = next_segment + strlen("]]>");
data/libhtp-0.5.35/test/gtest/gtest-all.cc:4746: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).
  result.reserve(strlen(str) + 1);
data/libhtp-0.5.35/test/gtest/gtest-all.cc:5851: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).
  const size_t prefix_len = strlen(prefix);
data/libhtp-0.5.35/test/gtest/gtest-all.cc:7952:33:  [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 full_regex_len = strlen(regex) + 10;
data/libhtp-0.5.35/test/gtest/gtest-all.cc:8206:22:  [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 len = strlen(regex);
data/libhtp-0.5.35/test/gtest/gtest-all.cc:8854: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).
    PrintCharsAsStringTo(s, strlen(s), os);
data/libhtp-0.5.35/test/gtest/gtest-all.cc:8871:33:  [1] (buffer) wcslen:
  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).
    PrintWideCharsAsStringTo(s, wcslen(s), os);
data/libhtp-0.5.35/test/gtest/gtest.h:2672:10:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  return strncpy(dest, src, n);
data/libhtp-0.5.35/test/gtest/gtest.h:2694:27:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  return static_cast<int>(read(fd, buf, count));
data/libhtp-0.5.35/test/gtest/gtest.h:3050:33:  [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).
      ConstructNonNull(a_c_str, strlen(a_c_str));
data/libhtp-0.5.35/test/test-tcpick.c:94:49:  [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).
    *response_offset = bstr_util_mem_to_pint(p, strlen(p), 10, &lastlen);
data/libhtp-0.5.35/test/test-tcpick.c:102: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).
    *response_len = bstr_util_mem_to_pint(p, strlen(p), 10, &lastlen);
data/libhtp-0.5.35/test/test-tcpick.c:207:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if (read != len) {
data/libhtp-0.5.35/test/test-tcpick.c:335:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(buf, dirname, 1024);
data/libhtp-0.5.35/test/test-tcpick.c:336:13:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings. Risk is low because the source is a
  constant character.
            strncat(buf, "/", 1024 - strlen(buf));
data/libhtp-0.5.35/test/test-tcpick.c:336:38:  [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).
            strncat(buf, "/", 1024 - strlen(buf));
data/libhtp-0.5.35/test/test-tcpick.c:337:13:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
            strncat(buf, entry->d_name, 1024 - strlen(buf));
data/libhtp-0.5.35/test/test-tcpick.c:337:48:  [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).
            strncat(buf, entry->d_name, 1024 - strlen(buf));
data/libhtp-0.5.35/test/test.c:132:26:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while ((bytes_read = read(fd, test->buf + test->len, buf.st_size - test->len)) > 0) {
data/libhtp-0.5.35/test/test.c:290:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(filename, testsdir, 1024);
data/libhtp-0.5.35/test/test.c:291:5:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings. Risk is low because the source is a
  constant character.
    strncat(filename, "/", 1024 - strlen(filename));
data/libhtp-0.5.35/test/test.c:291: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).
    strncat(filename, "/", 1024 - strlen(filename));
data/libhtp-0.5.35/test/test.c:292:5:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
    strncat(filename, testname, 1024 - strlen(filename));
data/libhtp-0.5.35/test/test.c:292: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).
    strncat(filename, testname, 1024 - strlen(filename));
data/libhtp-0.5.35/test/test_bstr.cpp:540: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).
    bstr_adjust_len(b, strlen(c));
data/libhtp-0.5.35/test/test_bstr.cpp:550: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).
    size_t len = strlen(data);
data/libhtp-0.5.35/test/test_gunzip.cpp:68:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(filename, home, 1024);
data/libhtp-0.5.35/test/test_gunzip.cpp:69:9:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings. Risk is low because the source is a
  constant character.
        strncat(filename, "/", 1024 - strlen(filename));
data/libhtp-0.5.35/test/test_gunzip.cpp:69:39:  [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).
        strncat(filename, "/", 1024 - strlen(filename));
data/libhtp-0.5.35/test/test_gunzip.cpp:70:9:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
        strncat(filename, f, 1024 - strlen(filename));
data/libhtp-0.5.35/test/test_gunzip.cpp:70:37:  [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).
        strncat(filename, f, 1024 - strlen(filename));
data/libhtp-0.5.35/test/test_gunzip.cpp:95:30:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        ssize_t bytes_read = read(fd, (void *) d.data, d.len);
data/libhtp-0.5.35/test/test_hybrid.cpp:416:13:  [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).
            strlen(HTP_URLENCODED_MIME_TYPE), HTP_ALLOC_COPY);
data/libhtp-0.5.35/test/test_hybrid.cpp:493:74:  [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).
    bstr *body = htp_base64_decode_mem(HybridParsing_CompressedResponse, strlen(HybridParsing_CompressedResponse));
data/libhtp-0.5.35/test/test_hybrid.cpp:648:13:  [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).
            strlen(HTP_URLENCODED_MIME_TYPE), HTP_ALLOC_COPY);
data/libhtp-0.5.35/test/test_main.cpp:1197:21:  [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).
    ASSERT_EQ(1023, strlen(tx->connp->last_error->msg));
data/libhtp-0.5.35/test/test_multipart.cpp:55: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).
            bodyLen += strlen(data[i]);
data/libhtp-0.5.35/test/test_multipart.cpp:65:57:  [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).
            htp_connp_req_data(connp, NULL, headers[i], strlen(headers[i]));
data/libhtp-0.5.35/test/test_multipart.cpp:70: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).
        htp_connp_req_data(connp, NULL, buf, strlen(buf));
data/libhtp-0.5.35/test/test_multipart.cpp:76:54:  [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).
            htp_connp_req_data(connp, NULL, data[i], strlen(data[i]));
data/libhtp-0.5.35/test/test_multipart.cpp:133:48:  [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).
            htp_mpartp_parse(mpartp, parts[i], strlen(parts[i]));
data/libhtp-0.5.35/test/test_multipart.cpp:248:44:  [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).
        htp_mpartp_parse(mpartp, parts[i], strlen(parts[i]));
data/libhtp-0.5.35/test/test_multipart.cpp:319: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).
    htp_mpartp_parse(mpartp, i1, strlen(i1));
data/libhtp-0.5.35/test/test_multipart.cpp:320: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).
    htp_mpartp_parse(mpartp, i2, strlen(i2));
data/libhtp-0.5.35/test/test_multipart.cpp:321: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).
    htp_mpartp_parse(mpartp, i3, strlen(i3));
data/libhtp-0.5.35/test/test_multipart.cpp:322: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).
    htp_mpartp_parse(mpartp, i4, strlen(i4));
data/libhtp-0.5.35/test/test_multipart.cpp:323: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).
    htp_mpartp_parse(mpartp, i5, strlen(i5));
data/libhtp-0.5.35/test/test_multipart.cpp:324: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).
    htp_mpartp_parse(mpartp, i6, strlen(i6));
data/libhtp-0.5.35/test/test_multipart.cpp:325: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).
    htp_mpartp_parse(mpartp, i7, strlen(i7));
data/libhtp-0.5.35/test/test_multipart.cpp:326: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).
    htp_mpartp_parse(mpartp, i8, strlen(i8));
data/libhtp-0.5.35/test/test_multipart.cpp:327: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).
    htp_mpartp_parse(mpartp, i9, strlen(i9));
data/libhtp-0.5.35/test/test_multipart.cpp:972:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ssize_t result = read(fd, buf, 6);
data/libhtp-0.5.35/test/test_multipart.cpp:1267: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).
    htp_mpartp_parse(mpartp, i1, strlen(i1));
data/libhtp-0.5.35/test/test_multipart.cpp:1269: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).
    htp_mpartp_parse(mpartp, i3, strlen(i3));
data/libhtp-0.5.35/test/test_utils.cpp:69: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).
    bstr *out = htp_base64_decode_mem(input, strlen(input));
data/libhtp-0.5.35/test/test_utils.cpp:112:11:  [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).
    len = strlen(data);
data/libhtp-0.5.35/test/test_utils.cpp:118:11:  [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).
    len = strlen(data);
data/libhtp-0.5.35/test/test_utils.cpp:124:11:  [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).
    len = strlen(data);
data/libhtp-0.5.35/test/test_utils.cpp:130:11:  [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).
    len = strlen(data);
data/libhtp-0.5.35/test/test_utils.cpp:136:11:  [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).
    len = strlen(data);
data/libhtp-0.5.35/test/test_utils.cpp:142:11:  [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).
    len = strlen(data);
data/libhtp-0.5.35/test/test_utils.cpp:147:5:  [1] (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). Risk is low because the source is a constant character.
    strcpy(data, "");
data/libhtp-0.5.35/test/test_utils.cpp:148:11:  [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).
    len = strlen(data);
data/libhtp-0.5.35/test/test_utils.cpp:179:5:  [1] (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). Risk is low because the source is a constant character.
    strcpy(data, "\r");
data/libhtp-0.5.35/test/test_utils.cpp:192:5:  [1] (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). Risk is low because the source is a constant character.
    strcpy(data, "\r");
data/libhtp-0.5.35/test/test_utils.cpp:348:9:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
    if (equal) {

ANALYSIS SUMMARY:

Hits = 214
Lines analyzed = 63392 in approximately 1.77 seconds (35888 lines/second)
Physical Source Lines of Code (SLOC) = 38236
Hits@level = [0] 211 [1]  94 [2]  82 [3]  16 [4]  22 [5]   0
Hits@level+ = [0+] 425 [1+] 214 [2+] 120 [3+]  38 [4+]  22 [5+]   0
Hits/KSLOC@level+ = [0+] 11.1152 [1+] 5.59682 [2+] 3.1384 [3+] 0.993828 [4+] 0.575374 [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.