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/ocaml-magic-0.7.3/src/magic_stubs.c

FINAL RESULTS:

data/ocaml-magic-0.7.3/src/magic_stubs.c:37:3:  [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, "DEBUG magic_stub: " __VA_ARGS__);    \
data/ocaml-magic-0.7.3/src/magic_stubs.c:78:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    strcpy(errmsg, fname);
data/ocaml-magic-0.7.3/src/magic_stubs.c:79:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    strcpy(errmsg + flen, err_magic);
data/ocaml-magic-0.7.3/src/magic_stubs.c:90:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    strcpy(errmsg, fname);
data/ocaml-magic-0.7.3/src/magic_stubs.c:99:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
      strcpy(errmsg, fname);
data/ocaml-magic-0.7.3/src/magic_stubs.c:173:7:  [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(errmsg, "Magic.create: "); /* 14 chars */
data/ocaml-magic-0.7.3/src/magic_stubs.c:180:9:  [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(errmsg, "Magic.create: ");
data/ocaml-magic-0.7.3/src/magic_stubs.c:69:20:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  const int flen = strlen(fname);
data/ocaml-magic-0.7.3/src/magic_stubs.c:75: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).
    if ((errmsg = malloc(flen + strlen(err_magic) + 1)) == NULL)
data/ocaml-magic-0.7.3/src/magic_stubs.c:102: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(errmsg, strerror(err), len - flen - 1);
data/ocaml-magic-0.7.3/src/magic_stubs.c:183:7:  [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(errmsg, strerror(err), len - 15);

ANALYSIS SUMMARY:

Hits = 11
Lines analyzed = 310 in approximately 0.02 seconds (14249 lines/second)
Physical Source Lines of Code (SLOC) = 219
Hits@level = [0]   1 [1]   4 [2]   2 [3]   0 [4]   5 [5]   0
Hits@level+ = [0+]  12 [1+]  11 [2+]   7 [3+]   5 [4+]   5 [5+]   0
Hits/KSLOC@level+ = [0+] 54.7945 [1+] 50.2283 [2+] 31.9635 [3+] 22.8311 [4+] 22.8311 [5+]   0
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.