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/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached_server.c
Examining data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached_session.c
Examining data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached.c
Examining data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached.h
Examining data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/g_fmt.c
Examining data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/fastlz/fastlz.c
Examining data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/fastlz/fastlz.h
Examining data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_libmemcached_compat.h
Examining data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached_private.h
Examining data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_libmemcached_compat.c
Examining data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached_session.h
Examining data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached_server.h
Examining data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/g_fmt.h
Examining data/php-memcached-3.1.4+2.2.0/memcached-3.1.4/php_memcached_server.c
Examining data/php-memcached-3.1.4+2.2.0/memcached-3.1.4/php_memcached_session.c
Examining data/php-memcached-3.1.4+2.2.0/memcached-3.1.4/php_memcached.c
Examining data/php-memcached-3.1.4+2.2.0/memcached-3.1.4/php_memcached.h
Examining data/php-memcached-3.1.4+2.2.0/memcached-3.1.4/g_fmt.c
Examining data/php-memcached-3.1.4+2.2.0/memcached-3.1.4/fastlz/fastlz.c
Examining data/php-memcached-3.1.4+2.2.0/memcached-3.1.4/fastlz/fastlz.h
Examining data/php-memcached-3.1.4+2.2.0/memcached-3.1.4/php_libmemcached_compat.h
Examining data/php-memcached-3.1.4+2.2.0/memcached-3.1.4/php_memcached_private.h
Examining data/php-memcached-3.1.4+2.2.0/memcached-3.1.4/php_libmemcached_compat.c
Examining data/php-memcached-3.1.4+2.2.0/memcached-3.1.4/php_memcached_session.h
Examining data/php-memcached-3.1.4+2.2.0/memcached-3.1.4/php_memcached_server.h
Examining data/php-memcached-3.1.4+2.2.0/memcached-3.1.4/g_fmt.h

FINAL RESULTS:

data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached.c:452: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 error_buffer[1024];
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached.c:817: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 res_key [MEMCACHED_MAX_KEY];
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached.c:835: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 (res_key, tmp_key, res_key_len >= MEMCACHED_MAX_KEY ? MEMCACHED_MAX_KEY - 1 : res_key_len);
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached.c:1240:2:  [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  tmp_key[MEMCACHED_MAX_KEY];
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached.c:1278:18:  [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.
			str_key_len = sprintf(tmp_key, "%ld", (long)num_key) + 1;
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached.c:2424:4:  [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 tmp[MEMCACHED_PREFIX_KEY_MAX_SIZE - 1];
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached.c:3008:2:  [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 version[16];
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached.c:3091:2:  [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, &plen, sizeof(uint32_t));
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached.c:3217:2:  [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 tmp[40] = {0};
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached.c:3228:13:  [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.
			pl_len = sprintf(tmp, "%ld", Z_LVAL_P(value));
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached.c:3298: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(&len, payload, sizeof(uint32_t));
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached.c:3448:4:  [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 conv_buf [128];
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached.c:3455: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 (conv_buf, pl, payload_len);
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached.c:3466:4:  [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 conv_buf [128];
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached.c:3473: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 (conv_buf, pl, payload_len);
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached.c:4488:2:  [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(&memcached_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached.c:4499:2:  [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(&memcached_server_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached_session.c:181:4:  [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_buffer[1024];
data/php-memcached-3.1.4+2.2.0/memcached-3.1.4/php_memcached.c:919: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(ZSTR_VAL(payload), &original_size, sizeof(uint32_t));
data/php-memcached-3.1.4+2.2.0/memcached-3.1.4/php_memcached.c:920: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(ZSTR_VAL(payload) + sizeof (uint32_t), buffer, compressed_size);
data/php-memcached-3.1.4+2.2.0/memcached-3.1.4/php_memcached.c:1040:4:  [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[40];
data/php-memcached-3.1.4+2.2.0/memcached-3.1.4/php_memcached.c:1892:4:  [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 tmp_key[64];
data/php-memcached-3.1.4+2.2.0/memcached-3.1.4/php_memcached.c:3591:2:  [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(&stored_length, payload, sizeof (uint32_t));
data/php-memcached-3.1.4+2.2.0/memcached-3.1.4/php_memcached.c:4588:2:  [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(&memcached_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
data/php-memcached-3.1.4+2.2.0/memcached-3.1.4/php_memcached.c:4600:2:  [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(&memcached_server_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached.c:2361: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).
				RETURN_STRINGL(result, strlen(result) - 1,  1);
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached.c:2995: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).
	add_assoc_stringl(entry, "version", context->stats[context->i].version, strlen(context->stats[context->i].version), 1);
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached.c:3236: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).
			pl_len = strlen(tmp);
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached_session.c:80:4:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
			usleep(lock_wait);
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached_session.c:178: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).
		memc_sess->memc_sess = php_memc_create_str(p, strlen(p));
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached_session.c:182: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).
			if (libmemcached_check_configuration(p, strlen(p), error_buffer, sizeof(error_buffer)) != MEMCACHED_SUCCESS) {
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached_session.c:297:16:  [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 key_len = strlen(key);
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached_session.c:303:15:  [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).
	key_length = strlen(MEMC_G(sess_prefix)) + key_len + 5; // prefix + "lock."
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached_session.c:331:16:  [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 key_len = strlen(key);
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached_session.c:338:15:  [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).
	key_length = strlen(MEMC_G(sess_prefix)) + key_len + 5; // prefix + "lock."
data/php-memcached-3.1.4+2.2.0/memcached-2.2.0/php_memcached_session.c:370: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).
	memcached_delete(memc_sess->memc_sess, key, strlen(key), 0);
data/php-memcached-3.1.4+2.2.0/memcached-3.1.4/php_memcached.c:1042: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).
			payload = zend_string_init (buffer, strlen (buffer), 0);
data/php-memcached-3.1.4+2.2.0/memcached-3.1.4/php_memcached_session.c:151:6:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
					usleep(wait_time * 1000);

ANALYSIS SUMMARY:

Hits = 38
Lines analyzed = 14405 in approximately 0.30 seconds (47325 lines/second)
Physical Source Lines of Code (SLOC) = 10393
Hits@level = [0]   5 [1]  13 [2]  25 [3]   0 [4]   0 [5]   0
Hits@level+ = [0+]  43 [1+]  38 [2+]  25 [3+]   0 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 4.1374 [1+] 3.65631 [2+] 2.40547 [3+]   0 [4+]   0 [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.