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/imx-code-signing-tool-3.3.0+dfsg/code/hab_csf_parser/extract_csf.c
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/hab_csf_parser/extract_csf.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/hab_csf_parser/csf_parser.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/hab_csf_parser/csf_parser.c
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/pkey.c
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/openssl_helper.c
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/ssl_wrapper.c
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/adapt_layer_openssl.c
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/hdr/version.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/hdr/pkey.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/hdr/openssl_helper.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/hdr/ssl_wrapper.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/hdr/adapt_layer.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/config.c
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/include/e_hsm.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/include/pkcs11f.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/include/pkcs11ext.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/include/e_hsm_err.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/include/pkcs11.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/include/pkcs-11v2-20a3.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/include/cryptoki.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/include/pkcs11t.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/include/config.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/include/adapt_layer.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/openssl_helper.c
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/e_hsm_err.c
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/e_hsm.c
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/csf_cmd_ins_key.c
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/csf_cmd_misc.c
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/csf_cmd_aut_dat.c
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/cst.c
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/hdr/bitops.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/hdr/ahab_types.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/hdr/hab_types.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/hdr/hab_cmd.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/hdr/arch_types.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/hdr/adapt_layer.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/hdr/csf.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/pkey.c
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/adapt_layer_openssl.c
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/ssl_wrapper.c
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/hdr/pkey.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/hdr/ssl_wrapper.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/srktool/src/srktool.c
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/convlb/src/convlb.c
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/common/src/openssl_helper.c
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/common/src/err.c
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/common/src/srk_helper.c
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/common/hdr/srk_helper.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/common/hdr/err.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/common/hdr/version.h
Examining data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/common/hdr/openssl_helper.h

FINAL RESULTS:

data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:286:4:  [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, err_str);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:402:4:  [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, err_str);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:896:4:  [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, err_str);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:904:4:  [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, err_str);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:944:4:  [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, err_str);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:956:4:  [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, err_str);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:978:4:  [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, err_str);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:998:4:  [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, err_str);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:1008:4:  [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, err_str);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:1019:4:  [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, err_str);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:1033:4:  [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, err_str);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:1041:4:  [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, err_str);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:1276:4:  [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, err_str);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:1295:8:  [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, err_str);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:1305:8:  [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, err_str);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:1320:8:  [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, err_str);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:1342:8:  [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, err_str);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:1355:8:  [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, err_str);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:1366:4:  [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, err_str);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:1378:4:  [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, err_str);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:1389:4:  [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, err_str);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:1401:4:  [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, err_str);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/config.c:66:3:  [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(config->module_path, hsm_module);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/config.c:73:3:  [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(config->pin, hsm_pin);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/config.c:103:4:  [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(hobject->id, id);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/config.c:104:4:  [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(hobject->file, file);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/e_hsm.c:78:35:  [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.
#define dbg_fprintf(args...) do { fprintf(stderr, args); fflush(stderr); } while (0)
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/adapt_layer_openssl.c:642:13:  [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(err_str, MAX_ERR_STR_BYTES,                      \
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/pkey.c:149: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(key_file, cert_file);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/adapt_layer_openssl.c:642:13:  [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(err_str, MAX_ERR_STR_BYTES,                      \
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/pkey.c:149: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(key_file, cert_file);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/common/src/err.c:65: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(err, args);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:579: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(data_filename, data_filename_prefix);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:585:5:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
    strcat(data_filename, t_str);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:600:9:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
        strcat(data_filename, tmp);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/csf_cmd_misc.c:264:19:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
        if (-1 != access(SIG_REQ_FILENAME, F_OK))
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/srktool/src/srktool.c:619:13:  [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(tmp_str, "Unable to write to file %s\n", fuses_filename);
data/imx-code-signing-tool-3.3.0+dfsg/code/hab_csf_parser/csf_parser.h:63:33:  [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(fp_output, x"\tVALUE\t\tDEFINITION\t\tDESCRIPTION\n"); \
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/cst.c:1544:23:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        next_option = getopt_long(argc, argv, short_options,
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/srktool/src/srktool.c:1181:23:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        next_option = getopt_long(argc, argv, short_options,
data/imx-code-signing-tool-3.3.0+dfsg/code/hab_csf_parser/csf_parser.c:1274:28:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
                next_opt = getopt_long(argc, argv, short_opt, long_opt, NULL);
data/imx-code-signing-tool-3.3.0+dfsg/code/hab_csf_parser/csf_parser.c:1337:28:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
                next_opt = getopt_long(argc, argv, short_opt, long_opt, NULL);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:262: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 err_str[MAX_ERR_STR_BYTES];	 /**< Error string            */
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:339:7:  [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 (sig_buf + (key_size - bn_bytes), r, bn_bytes);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:343:7:  [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 (sig_buf + key_size + (key_size - bn_bytes), s, bn_bytes);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:375: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 err_str[MAX_ERR_STR_BYTES];
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:471: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 err_str[MAX_ERR_STR_BYTES];
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:519:7:  [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 (sig_buf, rsa_out, rsa_outbytes);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:881: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 err_str[MAX_ERR_STR_BYTES];	 /**< Used in preparing error message */
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:892:17:  [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).
      if ((fh = fopen (enc_file, "wb")) == NULL)
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:927: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 err_str[MAX_ERR_STR_BYTES];	 /**< Used in preparing error message */
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:1029:17:  [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).
      if ((fh = fopen (enc_file, "wb")) == NULL)
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:1196:13:  [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).
      fho = fopen (out_file, "wb");
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:1257: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 err_str[MAX_ERR_STR_BYTES];	 /**< Array to hold error string */
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:1290:9:  [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).
	  fh = fopen (key_file, "rb");
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:1361:12:  [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).
      fh = fopen (in_file, "rb");
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/backend.c:1384:12:  [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).
      fh = fopen (in_file, "rb");
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/e_hsm.c:392: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 errbuf[20]; \
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/e_hsm.c:394:3:  [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(errbuf, "%lx", rv); \
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/include/config.h:57: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 id[MAX_ID_LEN]; /*HSM Object ID*/
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/include/config.h:58: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 file[MAX_PATH]; /*Object path on file system*/
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/include/config.h:63:11:  [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 module_path[MAX_PATH];
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/include/config.h:64:11:  [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 pin[MAX_PIN_LEN];
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/adapt_layer_openssl.c:293: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 err_str[MAX_ERR_STR_BYTES];
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/adapt_layer_openssl.c:346: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(sig_buf, rsa_out, rsa_outbytes);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/adapt_layer_openssl.c:416:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char err_str[MAX_ERR_STR_BYTES];
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/adapt_layer_openssl.c:526: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         err_str[MAX_ERR_STR_BYTES]; /**< Error string            */
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/adapt_layer_openssl.c:601: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(sig_buf + (key_size - bn_bytes),
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/adapt_layer_openssl.c:607: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(sig_buf + key_size + (key_size - bn_bytes),
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/adapt_layer_openssl.c:648: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 err_str[MAX_ERR_STR_BYTES]; /**< Used in preparing error message  */
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/adapt_layer_openssl.c:650: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 line[MAX_LINE_CHARS];       /**< Used in preparing output message */
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/adapt_layer_openssl.c:652: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).
    sig_req = fopen(SIG_REQ_FILENAME, "a");
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/adapt_layer_openssl.c:753: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 err_str[MAX_ERR_STR_BYTES];  /**< Used in preparing error message */
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/adapt_layer_openssl.c:763: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).
        if ((fh = fopen(enc_file, "wb")) == NULL) {
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/adapt_layer_openssl.c:796: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 err_str[MAX_ERR_STR_BYTES];  /**< Used in preparing error message */
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/adapt_layer_openssl.c:890: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).
        if ((fh = fopen(enc_file, "wb")) == NULL) {
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/adapt_layer_openssl.c:944: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 err_str[MAX_ERR_STR_BYTES];         /**< Array to hold error string */
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/adapt_layer_openssl.c:976:22:  [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).
                fh = fopen(key_file, "rb");
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/adapt_layer_openssl.c:1041:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fh = fopen(in_file, "rb");
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/adapt_layer_openssl.c:1061:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fh = fopen(in_file, "rb");
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/openssl_helper.c:342:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fp = fopen(filename, "rb");
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/pkey.c:92: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 key_file_path[255];
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/pkey.c:116:5:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
    strcat(key_file_path, "key_pass.txt");
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/pkey.c:122: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).
    password_fp = fopen(key_file_path, "r");
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/ssl_wrapper.c:155: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).
        fho = fopen(out_file, "wb");
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/ssl_wrapper.c:275:21:  [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 *out = fopen(out_file, "wb");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/adapt_layer_openssl.c:293: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 err_str[MAX_ERR_STR_BYTES];
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/adapt_layer_openssl.c:346: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(sig_buf, rsa_out, rsa_outbytes);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/adapt_layer_openssl.c:416:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char err_str[MAX_ERR_STR_BYTES];
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/adapt_layer_openssl.c:526: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         err_str[MAX_ERR_STR_BYTES]; /**< Error string            */
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/adapt_layer_openssl.c:601: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(sig_buf + (key_size - bn_bytes),
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/adapt_layer_openssl.c:607: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(sig_buf + key_size + (key_size - bn_bytes),
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/adapt_layer_openssl.c:648: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 err_str[MAX_ERR_STR_BYTES]; /**< Used in preparing error message  */
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/adapt_layer_openssl.c:650: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 line[MAX_LINE_CHARS];       /**< Used in preparing output message */
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/adapt_layer_openssl.c:652: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).
    sig_req = fopen(SIG_REQ_FILENAME, "a");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/adapt_layer_openssl.c:753: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 err_str[MAX_ERR_STR_BYTES];  /**< Used in preparing error message */
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/adapt_layer_openssl.c:763: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).
        if ((fh = fopen(enc_file, "wb")) == NULL) {
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/adapt_layer_openssl.c:796: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 err_str[MAX_ERR_STR_BYTES];  /**< Used in preparing error message */
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/adapt_layer_openssl.c:890: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).
        if ((fh = fopen(enc_file, "wb")) == NULL) {
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/adapt_layer_openssl.c:944: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 err_str[MAX_ERR_STR_BYTES];         /**< Array to hold error string */
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/adapt_layer_openssl.c:976:22:  [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).
                fh = fopen(key_file, "rb");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/adapt_layer_openssl.c:1041:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fh = fopen(in_file, "rb");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/adapt_layer_openssl.c:1061:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fh = fopen(in_file, "rb");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/pkey.c:92: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 key_file_path[255];
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/pkey.c:116:5:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
    strcat(key_file_path, "key_pass.txt");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/pkey.c:122: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).
    password_fp = fopen(key_file_path, "r");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/ssl_wrapper.c:155: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).
        fho = fopen(out_file, "wb");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/ssl_wrapper.c:276:21:  [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 *out = fopen(out_file, "wb");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/common/src/openssl_helper.c:342:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fp = fopen(filename, "rb");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/common/src/srk_helper.c:59:1:  [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 *dest, const void *src, size_t len)
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/common/src/srk_helper.c:192: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(&srk->entry[idx], modulus, mod_bytes);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/common/src/srk_helper.c:196: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(&srk->entry[idx], exponent, exp_bytes);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/convlb/src/convlb.c:85:12:  [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 = fopen(filepath, "rb");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/convlb/src/convlb.c:90:16:  [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).
    tempfile = fopen(TEMPFILENAME, "wb+");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/convlb/src/convlb.c:104:12:  [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 = fopen(filepath, "wb");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:77:1:  [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 err_msg[MAX_ERR_MSG_BYTES];
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:224:12:  [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 = fopen(filename, "rb");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:460: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(cert_nxp->entry + cert_hdr_bytes,
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:475:17:  [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).
    if ((file = fopen(filename, "wb")) == NULL)
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:518: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       t_str[4+2+2+2+2+2]; /* YYYY + MM + DD + HH + MM + "-\0" */
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:598: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 tmp[4];
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:605: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(data_filename
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:652: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(sig->entry + sig_hdr_bytes, sig_data.entry, sig_data.entry_bytes);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:685:21:  [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).
    if ((file_dst = fopen(dst, "wb")) == NULL)
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:818:27:  [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 *plaintext = fopen(FILE_PLAIN_DATA, "wb");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:895: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(image->iv, iv, SHA256_DIGEST_LENGTH);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:896: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(image->hash, hash, hash_size);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:986:20:  [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 *source = fopen(ahab_data->source, "rb");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:990:25:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    FILE *destination = tmpfile();
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:1045: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(sign_blk.entry + ahab_sig_blk->srk_table_offset,
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:1058: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(sign_blk.entry + ahab_sig_blk->certificate_offset,
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:1061: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(sign_blk.entry
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:1079: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(sign_blk.entry + ahab_sig_blk->blob_offset,
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:1111: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(container.entry,
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:1115: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(container.entry + cont_hdr.entry_bytes,
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:1133: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(container.entry + cont_unsig.entry_bytes,
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/csf_cmd_aut_dat.c:276:20:  [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 *fh = fopen(block->block_filename, "rb");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/csf_cmd_aut_dat.c:398: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(&g_csf_buffer[g_csf_buffer_index], aut_csf,
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/csf_cmd_aut_dat.c:485: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(&buf[*cmd_len], start, 4);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/csf_cmd_aut_dat.c:486: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(&buf[*cmd_len + 4], length, 4);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/csf_cmd_aut_dat.c:514: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(buf, aut_dat, AUT_DAT_BASE_BYTES);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/csf_cmd_aut_dat.c:712:22:  [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).
                fh = fopen(block->block_filename, "rb");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/csf_cmd_aut_dat.c:789:11:  [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).
    fho = fopen(file, "wb");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/csf_cmd_aut_dat.c:805:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fh = fopen(block->block_filename, "rb");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/csf_cmd_aut_dat.c:904: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).
    fh = fopen(file, "rb");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/csf_cmd_aut_dat.c:920: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).
        fho = fopen(block->block_filename, "rb+");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/csf_cmd_aut_dat.c:1079: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(&aead[4], nonce, nonce_bytes);    /**< next comes nonce_bytes */
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/csf_cmd_aut_dat.c:1080: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(&aead[4+nonce_bytes], mac, mac_bytes);   /**< and finally mac */
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/csf_cmd_aut_dat.c:1083:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fh = fopen(out_file, "wb");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/csf_cmd_ins_key.c:337: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(&buf[INS_KEY_BASE_BYTES], crt_hash, hash_len);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/csf_cmd_ins_key.c:347: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(buf, ins_key_cmd, INS_KEY_BASE_BYTES);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/csf_cmd_ins_key.c:388: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(buf, ins_key_cmd, INS_KEY_BASE_BYTES);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/csf_cmd_misc.c:371: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(&g_csf_buffer[g_csf_buffer_index], nop_cmd, NOP_BYTES);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/csf_cmd_misc.c:462: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(&g_csf_buffer[g_csf_buffer_index], set_eng, SET_ENG_BYTES);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/csf_cmd_misc.c:583: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(&g_csf_buffer[g_csf_buffer_index], init, HDR_BYTES);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/csf_cmd_misc.c:593: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(&g_csf_buffer[g_csf_buffer_index], feature_value, 4);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/cst.c:121:1:  [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 *g_key_certs[HAB_KEY_PUBLIC_MAX] = {
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/cst.c:385:1:  [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_log[MAX_ERROR_STR_LEN+1];
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/cst.c:1217:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fh = fopen(file, "rb");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/cst.c:1272: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(data+header_bytes, cert_data, cert_len);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/cst.c:1281: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(data, hdr, header_bytes);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/cst.c:1366:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fh = fopen(file, "wb");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/cst.c:1404:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fh = fopen(file, "wb");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/cst.c:1469: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(&buf[cmd->start_offset_cert_sig], offset_bytes, 4);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/cst.c:1668: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).
    fi = fopen(g_in_csf_file, "r");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/cst.c:1790: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).
            fo = fopen(out_bin_csf, "wb");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/srktool/src/srktool.c:488: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     tmp_str[MAX_STRING_BYTES]; /**< Array for temporary stings */
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/srktool/src/srktool.c:501:16:  [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_table = fopen(table_filename, "wb");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/srktool/src/srktool.c:586: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     tmp_str[MAX_STRING_BYTES]; /**< Array for temporary stings */
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/srktool/src/srktool.c:589:16:  [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_fuses = fopen(fuses_filename, "wb");
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/srktool/src/srktool.c:671: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 tmp_str[MAX_STRING_BYTES]; /**< Array for temporary stings */
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/srktool/src/srktool.c:792: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(&g_table_data[index], srk->entry, srk->entry_bytes);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/srktool/src/srktool.c:841:44:  [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).
    hab_version_t hab_ver = (hab_version_t)atoi(version_str);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/srktool/src/srktool.c:891:43:  [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).
    fuse_format_t format = (fuse_format_t)atoi(format_str);
data/imx-code-signing-tool-3.3.0+dfsg/code/hab_csf_parser/csf_parser.c:71: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.
        if (memcpy(mac_sec, csf_hdr, HAB_HDR_LEN(mac_sec_temp)) == NULL) {
data/imx-code-signing-tool-3.3.0+dfsg/code/hab_csf_parser/csf_parser.c:143: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.
        if (memcpy(sig_sec, csf_hdr, HAB_HDR_LEN(sig_sec_temp)) == NULL) {
data/imx-code-signing-tool-3.3.0+dfsg/code/hab_csf_parser/csf_parser.c:168: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 sig_fn[16];
data/imx-code-signing-tool-3.3.0+dfsg/code/hab_csf_parser/csf_parser.c:170:24:  [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 *fp_sig = fopen(sig_fn, "w");
data/imx-code-signing-tool-3.3.0+dfsg/code/hab_csf_parser/csf_parser.c:648: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.
        if (memcpy(aut_dat_cmd, csf_hdr, HAB_HDR_LEN(aut_dat_cmd_temp)) == NULL) {
data/imx-code-signing-tool-3.3.0+dfsg/code/hab_csf_parser/csf_parser.c:1011:37:  [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 *fp_srkTable = fopen("output/SRKTable.bin", "w");
data/imx-code-signing-tool-3.3.0+dfsg/code/hab_csf_parser/csf_parser.c:1022: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 cert_fn[17];
data/imx-code-signing-tool-3.3.0+dfsg/code/hab_csf_parser/csf_parser.c:1024:33:  [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 *fp_cert = fopen(cert_fn, "w");
data/imx-code-signing-tool-3.3.0+dfsg/code/hab_csf_parser/csf_parser.c:1203: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).
        *fp = fopen(input_file, "r");
data/imx-code-signing-tool-3.3.0+dfsg/code/hab_csf_parser/csf_parser.c:1265:21:  [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_output = fopen("output/parsed_output.txt", "w");
data/imx-code-signing-tool-3.3.0+dfsg/code/hab_csf_parser/csf_parser.c:1282:36:  [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_debug = fopen("output/debug_log.txt", "w");
data/imx-code-signing-tool-3.3.0+dfsg/code/hab_csf_parser/extract_csf.c:101:32:  [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 *fp_csf = fopen("output/csf.bin", "w");
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/config.c:69:3:  [1] (buffer) scanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
		scanf("%256s", config->module_path);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/config.c:76:3:  [1] (buffer) scanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
		scanf("%32s", config->pin);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/e_hsm.c:444:19:  [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).
				   (CK_ULONG) strlen (wrapper->token->pin));
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end-hsm/src/e_hsm.c:2070: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).
  size_t hexstrLen = strlen (hexstr);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/adapt_layer_openssl.c:641: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).
        if (strlen(line) != fwrite(line, 1, strlen(line), sig_req)) { \
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/adapt_layer_openssl.c:641:45:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (strlen(line) != fwrite(line, 1, strlen(line), sig_req)) { \
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/adapt_layer_openssl.c:704: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).
    key_file = malloc(strlen(cert_file)+1);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/openssl_helper.c:318: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).
    const char *temp = filename + strlen(filename) -
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/openssl_helper.c:392: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).
    const char *temp = filename + strlen(filename) -
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/pkey.c:111:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(key_file_path, key_file, (ptr_to_last_slash -
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/pkey.c:133: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(buf);
data/imx-code-signing-tool-3.3.0+dfsg/code/back_end/src/pkey.c:146:17:  [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).
    int32_t i = strlen(cert_file);  /**< Index into key filename, initialized
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/adapt_layer_openssl.c:641: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).
        if (strlen(line) != fwrite(line, 1, strlen(line), sig_req)) { \
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/adapt_layer_openssl.c:641:45:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (strlen(line) != fwrite(line, 1, strlen(line), sig_req)) { \
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/adapt_layer_openssl.c:704: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).
    key_file = malloc(strlen(cert_file)+1);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/pkey.c:111:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(key_file_path, key_file, (ptr_to_last_slash -
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/pkey.c:133: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(buf);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/back_end/src/pkey.c:146:17:  [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).
    int32_t i = strlen(cert_file);  /**< Index into key filename, initialized
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/common/src/openssl_helper.c:318: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).
    const char *temp = filename + strlen(filename) -
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/common/src/openssl_helper.c:392: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).
    const char *temp = filename + strlen(filename) -
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:571: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).
    data_filename = malloc(strlen(data_filename_prefix)
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/acst.c:606: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).
           + strlen(data_filename_prefix)
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/cst.c:422:14:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        ch = fgetc(fp);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/cst.c:475: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).
    size_t log_len = strlen(error_log);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/cst.c:476: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).
    size_t input_len = strlen(error_msg);
data/imx-code-signing-tool-3.3.0+dfsg/code/cst/code/front_end/src/cst.c:481: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(error_log, error_msg, input_len);

ANALYSIS SUMMARY:

Hits = 212
Lines analyzed = 27438 in approximately 0.83 seconds (33088 lines/second)
Physical Source Lines of Code (SLOC) = 16296
Hits@level = [0] 887 [1]  26 [2] 144 [3]   4 [4]  38 [5]   0
Hits@level+ = [0+] 1099 [1+] 212 [2+] 186 [3+]  42 [4+]  38 [5+]   0
Hits/KSLOC@level+ = [0+] 67.4399 [1+] 13.0093 [2+] 11.4138 [3+] 2.57732 [4+] 2.33186 [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.