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/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa.c
Examining data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa_avl.h
Examining data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa_codes.c
Examining data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa.h
Examining data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa_slif.c
Examining data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa_ami.c
Examining data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa_obs.c
Examining data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa_tavl.c
Examining data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa_avl.c
Examining data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa_obs.h
Examining data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa_ami.h
Examining data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa_tavl.h
Examining data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa_slif.h
Examining data/libmarpa-6.1.0~dfsg/xs/ppport.h
Examining data/libmarpa-6.1.0~dfsg/libmarpa/avl/marpa_avl.h
Examining data/libmarpa-6.1.0~dfsg/libmarpa/avl/marpa_avl.c
Examining data/libmarpa-6.1.0~dfsg/libmarpa/obs/marpa_obs.c
Examining data/libmarpa-6.1.0~dfsg/libmarpa/obs/marpa_obs.h
Examining data/libmarpa-6.1.0~dfsg/libmarpa/shared/do_not_edit.c
Examining data/libmarpa-6.1.0~dfsg/libmarpa/shared/license.c
Examining data/libmarpa-6.1.0~dfsg/libmarpa/tavl/test.c
Examining data/libmarpa-6.1.0~dfsg/libmarpa/tavl/tavl-test.c
Examining data/libmarpa-6.1.0~dfsg/libmarpa/tavl/test.h
Examining data/libmarpa-6.1.0~dfsg/libmarpa/tavl/marpa_tavl.c
Examining data/libmarpa-6.1.0~dfsg/libmarpa/tavl/marpa_tavl.h

FINAL RESULTS:

data/libmarpa-6.1.0~dfsg/libmarpa/tavl/test.c:141:3:  [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.
  vfprintf (stderr, message, args);
data/libmarpa-6.1.0~dfsg/libmarpa/tavl/test.c:654:5:  [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.
    printf (*p, pgm_name);
data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa_ami.c:73:1:  [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.
vfprintf(stderr,format,args);
data/libmarpa-6.1.0~dfsg/xs/ppport.h:6890:14:  [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.
    retval = vsnprintf(buffer, len, format, ap);
data/libmarpa-6.1.0~dfsg/xs/ppport.h:6892:14:  [4] (format) vsprintf:
  Potential format string problem (CWE-134). Make format string constant.
    retval = vsprintf(buffer, format, ap);
data/libmarpa-6.1.0~dfsg/xs/ppport.h:6921:5:  [4] (format) vsprintf:
  Potential format string problem (CWE-134). Make format string constant.
    vsprintf(buffer, pat, args);
data/libmarpa-6.1.0~dfsg/libmarpa/tavl/test.c:1046:7:  [3] (random) srand:
  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.
      srand (opts.seed);
data/libmarpa-6.1.0~dfsg/libmarpa/tavl/test.c:1049:7:  [3] (random) srand:
  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.
      srand (++opts.seed);
data/libmarpa-6.1.0~dfsg/libmarpa/avl/marpa_avl.c:127: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 da[MARPA_AVL_MAX_HEIGHT]; /* Cached comparison results. */
data/libmarpa-6.1.0~dfsg/libmarpa/avl/marpa_avl.c:457:11:  [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 (trav->avl_stack, (const void *) src->avl_stack,
data/libmarpa-6.1.0~dfsg/libmarpa/obs/marpa_obs.h:86: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 contents[4];
data/libmarpa-6.1.0~dfsg/libmarpa/tavl/marpa_tavl.c:130: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 da[TAVL_MAX_HEIGHT]; /* Cached comparison results. */
data/libmarpa-6.1.0~dfsg/libmarpa/tavl/marpa_tavl.h:79:14:  [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 tavl_tag[2];      /* Tag fields. */
data/libmarpa-6.1.0~dfsg/libmarpa/tavl/test.c:488: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 name[16];                /* Option name. */
data/libmarpa-6.1.0~dfsg/libmarpa/tavl/test.c:505: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 (name, p, name_len);
data/libmarpa-6.1.0~dfsg/libmarpa/tavl/test.c:725:26:  [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.
            static const char *orders[INS_CNT] =
data/libmarpa-6.1.0~dfsg/libmarpa/tavl/test.c:747:26:  [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.
            static const char *orders[DEL_CNT] =
data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa.c:2370:1:  [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(buffer,"S%d@%d-%d",
data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa.c:2376:8:  [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.
static char DEBUG_yim_tag_buffer[1000];
data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa.c:2389:1:  [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(buffer,"L%d@%d",
data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa.c:2394:8:  [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.
static char DEBUG_lim_tag_buffer[1000];
data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa.c:2410:1:  [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(buffer,"R%d:%d@%d-%d",
data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa.c:2417:8:  [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.
static char DEBUG_or_tag_buffer[1000];
data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa.c:2433:1:  [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(buffer,"R%d@%d",IRLID_of_AHM(ahm),Position_of_AHM(ahm));
data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa.c:2435:1:  [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(buffer,"R%d@end",IRLID_of_AHM(ahm));
data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa.c:2440:8:  [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.
static char DEBUG_ahm_tag_buffer[1000];
data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa_avl.c:127: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 da[MARPA_AVL_MAX_HEIGHT]; /* Cached comparison results. */
data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa_avl.c:457:11:  [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 (trav->avl_stack, (const void *) src->avl_stack,
data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa_obs.h:86: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 contents[4];
data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa_tavl.c:130: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 da[TAVL_MAX_HEIGHT]; /* Cached comparison results. */
data/libmarpa-6.1.0~dfsg/libmarpa_dist/marpa_tavl.h:79:14:  [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 tavl_tag[2];      /* Tag fields. */
data/libmarpa-6.1.0~dfsg/xs/ppport.h:3842:42:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#  define CopyD(s,d,n,t)                 memcpy((char*)(d),(char*)(s), (n) * sizeof(t))
data/libmarpa-6.1.0~dfsg/xs/ppport.h:6745:24:  [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.
		&& (xdigit = strchr((char *) PL_hexdigit, s[1])))
data/libmarpa-6.1.0~dfsg/xs/ppport.h:6967: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(dst + used, src, copy);
data/libmarpa-6.1.0~dfsg/xs/ppport.h:6996: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(dst, src, copy);
data/libmarpa-6.1.0~dfsg/xs/ppport.h:7088: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 octbuf[32] = "%123456789ABCDF";
data/libmarpa-6.1.0~dfsg/xs/ppport.h:7158:6:  [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[2];
data/libmarpa-6.1.0~dfsg/xs/ppport.h:5335: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).
  sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));
data/libmarpa-6.1.0~dfsg/xs/ppport.h:5343: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).
#  define sv_vcatpvf(sv, pat, args)  sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
data/libmarpa-6.1.0~dfsg/xs/ppport.h:5347: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).
#  define sv_vsetpvf(sv, pat, args)  sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
data/libmarpa-6.1.0~dfsg/xs/ppport.h:5367: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).
  sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
data/libmarpa-6.1.0~dfsg/xs/ppport.h:5395: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).
  sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
data/libmarpa-6.1.0~dfsg/xs/ppport.h:5416: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).
     sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));  \
data/libmarpa-6.1.0~dfsg/xs/ppport.h:5438: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).
  sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
data/libmarpa-6.1.0~dfsg/xs/ppport.h:5466: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).
  sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
data/libmarpa-6.1.0~dfsg/xs/ppport.h:5487: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).
     sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));  \
data/libmarpa-6.1.0~dfsg/xs/ppport.h:5541:65:  [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).
#  define HvNAMELEN_get(hv)              (HvNAME_get(hv) ? (I32)strlen(HvNAME_get(hv)) : 0)
data/libmarpa-6.1.0~dfsg/xs/ppport.h:6339: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).
        STRLEN len = strlen(radix);
data/libmarpa-6.1.0~dfsg/xs/ppport.h:6923: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).
    return strlen(buffer);
data/libmarpa-6.1.0~dfsg/xs/ppport.h:6963: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).
    used = strlen(dst);
data/libmarpa-6.1.0~dfsg/xs/ppport.h:6964: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(src);
data/libmarpa-6.1.0~dfsg/xs/ppport.h:6993: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(src);

ANALYSIS SUMMARY:

Hits = 52
Lines analyzed = 37654 in approximately 0.79 seconds (47927 lines/second)
Physical Source Lines of Code (SLOC) = 23872
Hits@level = [0]  81 [1]  15 [2]  29 [3]   2 [4]   6 [5]   0
Hits@level+ = [0+] 133 [1+]  52 [2+]  37 [3+]   8 [4+]   6 [5+]   0
Hits/KSLOC@level+ = [0+] 5.57138 [1+] 2.17828 [2+] 1.54993 [3+] 0.335121 [4+] 0.25134 [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.