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/amide-1.0.5/win32/resource.h
Examining data/amide-1.0.5/src/amitk_dial.h
Examining data/amide-1.0.5/src/fads.h
Examining data/amide-1.0.5/src/amitk_roi.h
Examining data/amide-1.0.5/src/amitk_window_edit.h
Examining data/amide-1.0.5/src/tb_math.c
Examining data/amide-1.0.5/src/amide_intl.h
Examining data/amide-1.0.5/src/tb_profile.h
Examining data/amide-1.0.5/src/ui_common.c
Examining data/amide-1.0.5/src/tb_roi_analysis.h
Examining data/amide-1.0.5/src/amitk_point.h
Examining data/amide-1.0.5/src/amitk_threshold.h
Examining data/amide-1.0.5/src/ui_gate_dialog.c
Examining data/amide-1.0.5/src/ui_series.h
Examining data/amide-1.0.5/src/dcmtk_interface.cc
Examining data/amide-1.0.5/src/amide_gnome.h
Examining data/amide-1.0.5/src/amitk_common.c
Examining data/amide-1.0.5/src/amitk_color_table.c
Examining data/amide-1.0.5/src/libmdc_interface.c
Examining data/amide-1.0.5/src/amitk_raw_data.c
Examining data/amide-1.0.5/src/amitk_canvas.c
Examining data/amide-1.0.5/src/amitk_space_edit.h
Examining data/amide-1.0.5/src/ui_preferences_dialog.c
Examining data/amide-1.0.5/src/amitk_dial.c
Examining data/amide-1.0.5/src/ui_time_dialog.h
Examining data/amide-1.0.5/src/ui_render_dialog.h
Examining data/amide-1.0.5/src/amitk_canvas.h
Examining data/amide-1.0.5/src/ui_render.c
Examining data/amide-1.0.5/src/amitk_volume.c
Examining data/amide-1.0.5/src/amitk_data_set_variable_type.c
Examining data/amide-1.0.5/src/amitk_object_dialog.c
Examining data/amide-1.0.5/src/amitk_line_profile.c
Examining data/amide-1.0.5/src/ui_render_movie.h
Examining data/amide-1.0.5/src/analysis.h
Examining data/amide-1.0.5/src/raw_data_import.c
Examining data/amide-1.0.5/src/pixmaps.h
Examining data/amide-1.0.5/src/ui_time_dialog.c
Examining data/amide-1.0.5/src/amitk_progress_dialog.h
Examining data/amide-1.0.5/src/amitk_roi.c
Examining data/amide-1.0.5/src/image.h
Examining data/amide-1.0.5/src/ui_study_cb.c
Examining data/amide-1.0.5/src/tb_alignment.c
Examining data/amide-1.0.5/src/tb_fly_through.h
Examining data/amide-1.0.5/src/ui_study.h
Examining data/amide-1.0.5/src/ui_render.h
Examining data/amide-1.0.5/src/image.c
Examining data/amide-1.0.5/src/amitk_raw_data_variable_type.c
Examining data/amide-1.0.5/src/ui_series.c
Examining data/amide-1.0.5/src/tb_fads.h
Examining data/amide-1.0.5/src/ui_study.c
Examining data/amide-1.0.5/src/tb_distance.h
Examining data/amide-1.0.5/src/amitk_window_edit.c
Examining data/amide-1.0.5/src/libecat_interface.h
Examining data/amide-1.0.5/src/amitk_object.h
Examining data/amide-1.0.5/src/alignment_mutual_information.h
Examining data/amide-1.0.5/src/amitk_data_set.h
Examining data/amide-1.0.5/src/raw_data_import.h
Examining data/amide-1.0.5/src/xml.h
Examining data/amide-1.0.5/src/ui_preferences_dialog.h
Examining data/amide-1.0.5/src/amitk_line_profile.h
Examining data/amide-1.0.5/src/xml.c
Examining data/amide-1.0.5/src/amitk_filter.h
Examining data/amide-1.0.5/src/tb_crop.c
Examining data/amide-1.0.5/src/amitk_roi_variable_type.h
Examining data/amide-1.0.5/src/amitk_tree_view.h
Examining data/amide-1.0.5/src/amitk_fiducial_mark.h
Examining data/amide-1.0.5/src/amide.h
Examining data/amide-1.0.5/src/analysis.c
Examining data/amide-1.0.5/src/tb_export_data_set.h
Examining data/amide-1.0.5/src/amitk_data_set.c
Examining data/amide-1.0.5/src/tb_fads.c
Examining data/amide-1.0.5/src/amitk_color_table_menu.h
Examining data/amide-1.0.5/src/amitk_preferences.h
Examining data/amide-1.0.5/src/amitk_space.c
Examining data/amide-1.0.5/src/amitk_space_edit.c
Examining data/amide-1.0.5/src/amitk_canvas_object.h
Examining data/amide-1.0.5/src/alignment_procrustes.c
Examining data/amide-1.0.5/src/tb_filter.h
Examining data/amide-1.0.5/src/amitk_color_table_menu.c
Examining data/amide-1.0.5/src/legacy.c
Examining data/amide-1.0.5/src/tb_math.h
Examining data/amide-1.0.5/src/tb_alignment.h
Examining data/amide-1.0.5/src/amitk_filter.c
Examining data/amide-1.0.5/src/amitk_common.h
Examining data/amide-1.0.5/src/ui_gate_dialog.h
Examining data/amide-1.0.5/src/tb_fly_through.c
Examining data/amide-1.0.5/src/mpeg_encode.h
Examining data/amide-1.0.5/src/amitk_canvas_object.c
Examining data/amide-1.0.5/src/legacy.h
Examining data/amide-1.0.5/src/amitk_fiducial_mark.c
Examining data/amide-1.0.5/src/amitk_preferences.c
Examining data/amide-1.0.5/src/amitk_study.h
Examining data/amide-1.0.5/src/ui_common.h
Examining data/amide-1.0.5/src/amitk_data_set_variable_type.h
Examining data/amide-1.0.5/src/amitk_raw_data_variable_type.h
Examining data/amide-1.0.5/src/tb_filter.c
Examining data/amide-1.0.5/src/amitk_point.c
Examining data/amide-1.0.5/src/amitk_tree_view.c
Examining data/amide-1.0.5/src/ui_study_cb.h
Examining data/amide-1.0.5/src/amitk_volume.h
Examining data/amide-1.0.5/src/ui_render_dialog.c
Examining data/amide-1.0.5/src/amitk_raw_data.h
Examining data/amide-1.0.5/src/tb_roi_analysis.c
Examining data/amide-1.0.5/src/amitk_study.c
Examining data/amide-1.0.5/src/tb_distance.c
Examining data/amide-1.0.5/src/amitk_object_dialog.h
Examining data/amide-1.0.5/src/pixmaps.c
Examining data/amide-1.0.5/src/amitk_color_table.h
Examining data/amide-1.0.5/src/tb_crop.h
Examining data/amide-1.0.5/src/amitk_space.h
Examining data/amide-1.0.5/src/alignment_procrustes.h
Examining data/amide-1.0.5/src/ui_render_movie.c
Examining data/amide-1.0.5/src/amide_gconf.h
Examining data/amide-1.0.5/src/dcmtk_interface.h
Examining data/amide-1.0.5/src/libmdc_interface.h
Examining data/amide-1.0.5/src/libecat_interface.c
Examining data/amide-1.0.5/src/fads.c
Examining data/amide-1.0.5/src/amitk_progress_dialog.c
Examining data/amide-1.0.5/src/amitk_roi_variable_type.c
Examining data/amide-1.0.5/src/render.c
Examining data/amide-1.0.5/src/tb_export_data_set.c
Examining data/amide-1.0.5/src/amide.c
Examining data/amide-1.0.5/src/amitk_type.h
Examining data/amide-1.0.5/src/amitk_object.c
Examining data/amide-1.0.5/src/amitk_threshold.c
Examining data/amide-1.0.5/src/tb_profile.c
Examining data/amide-1.0.5/src/alignment_mutual_information.c
Examining data/amide-1.0.5/src/amide_gconf.c
Examining data/amide-1.0.5/src/amide_gnome.c
Examining data/amide-1.0.5/src/mpeg_encode.c
Examining data/amide-1.0.5/src/render.h
Examining data/amide-1.0.5/attic/amitk_xif_sel.h
Examining data/amide-1.0.5/attic/amitk_list_view.h
Examining data/amide-1.0.5/attic/amitk_xif_sel.c
Examining data/amide-1.0.5/attic/amitk_list_view.c

FINAL RESULTS:

data/amide-1.0.5/src/amitk_data_set.c:1584:6:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	if (chmod(filename, 0400 | file_info.st_mode) != 0) 
data/amide-1.0.5/src/amitk_data_set.c:1591:6:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	if (chmod(header_filename, 0400 | file_info.st_mode) != 0) 
data/amide-1.0.5/src/amitk_data_set.c:1598:6:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	if (chmod(raw_filename, 0400 | file_info.st_mode) != 0) 
data/amide-1.0.5/attic/amitk_xif_sel.c:2561: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 (cmpl_state->updated_text, text);
data/amide-1.0.5/attic/amitk_xif_sel.c:2575: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 (cmpl_state->updated_text, text);
data/amide-1.0.5/attic/amitk_xif_sel.c:2580: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 (cmpl_state->updated_text, dir->fullname);
data/amide-1.0.5/attic/amitk_xif_sel.c:2585:6:  [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 (cmpl_state->updated_text, slash);
data/amide-1.0.5/attic/amitk_xif_sel.c:2591: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 (cmpl_state->updated_text, cmpl_state->reference_dir->fullname);
data/amide-1.0.5/attic/amitk_xif_sel.c:2593:2:  [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 (cmpl_state->updated_text, G_DIR_SEPARATOR_S);
data/amide-1.0.5/attic/amitk_xif_sel.c:2594:7:  [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 (cmpl_state->updated_text, text);
data/amide-1.0.5/attic/amitk_xif_sel.c:2658: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 (utf8_cwd, G_DIR_SEPARATOR_S);
data/amide-1.0.5/attic/amitk_xif_sel.c:3626:7:  [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 (cmpl_state->the_completion.text, text);
data/amide-1.0.5/attic/amitk_xif_sel.c:3641:7:  [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 (cmpl_state->the_completion.text, text);
data/amide-1.0.5/attic/amitk_xif_sel.c:3739: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 (cmpl_state->updated_text, cmpl_this_completion (poss));
data/amide-1.0.5/attic/amitk_xif_sel.c:3759:2:  [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 (cmpl_state->updated_text, cmpl_this_completion (poss));
data/amide-1.0.5/attic/amitk_xif_sel.c:3807: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 (pat_buf, dir->cmpl_text);
data/amide-1.0.5/attic/amitk_xif_sel.c:3923: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 (buf_ptr, utf8);
data/amide-1.0.5/attic/amitk_xif_sel.c:3932: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 (buf_ptr, utf8);
data/amide-1.0.5/src/amitk_data_set.c:1556:30:  [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.
    incorrect_permissions = (access(filename, R_OK) != 0);
data/amide-1.0.5/src/amitk_data_set.c:1560:36:  [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.
      incorrect_hdr_permissions = (access(header_filename, R_OK) != 0);
data/amide-1.0.5/src/amitk_data_set.c:1564:36:  [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.
      incorrect_raw_permissions = (access(raw_filename, R_OK) != 0);
data/amide-1.0.5/src/xml.c:566:2:  [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(temp_str, num_str);
data/amide-1.0.5/src/xml.c:569:2:  [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(temp_str, temp_str2);
data/amide-1.0.5/src/xml.c:572:2:  [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(temp_str, num_str);
data/amide-1.0.5/attic/amitk_xif_sel.c:2985:30:  [3] (buffer) g_get_home_dir:
  This function is synonymous with 'getenv("HOME")';it returns untrustable
  input if the environment can beset by an attacker. It can have any content
  and length, and the same variable can be set more than once (CWE-807,
  CWE-20). Check environment variables carefully before using them.
      const gchar *homedir = g_get_home_dir ();
data/amide-1.0.5/src/amide_gconf.c:468:10:  [3] (buffer) g_get_home_dir:
  This function is synonymous with 'getenv("HOME")';it returns untrustable
  input if the environment can beset by an attacker. It can have any content
  and length, and the same variable can be set more than once (CWE-807,
  CWE-20). Check environment variables carefully before using them.
  home = g_get_home_dir();
data/amide-1.0.5/attic/amitk_xif_sel.c:919: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 this_hostname[257];
data/amide-1.0.5/attic/amitk_xif_sel.c:1002: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 hostname[256];
data/amide-1.0.5/attic/amitk_xif_sel.c:2033: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 formatBuffer[128];
data/amide-1.0.5/attic/amitk_xif_sel.c:2553:16:  [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 nothing[2] = "";
data/amide-1.0.5/attic/amitk_xif_sel.c:2874:7:  [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 root_dir[5];
data/amide-1.0.5/src/amitk_common.c:314: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 ((study_file = fopen(filename, "rb")) == NULL) 
data/amide-1.0.5/src/amitk_data_set.c:1810:23:  [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_pointer = fopen(filename, "wb")) == NULL) {
data/amide-1.0.5/src/amitk_data_set.c:4782:6:  [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(amitk_raw_data_get_pointer(cropped->raw_data, i),
data/amide-1.0.5/src/amitk_raw_data.c:377:31:  [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 ((new_file_pointer = fopen(file_name, "r")) == NULL) {
data/amide-1.0.5/src/amitk_raw_data.c:382:31:  [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 ((new_file_pointer = fopen(file_name, "rb")) == NULL) {
data/amide-1.0.5/src/amitk_raw_data.c:828:25:  [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_pointer = fopen(raw_filename, "wb")) == NULL) {
data/amide-1.0.5/src/amitk_study.c:981: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 ((study_file = fopen(study_filename, "rb")) == NULL) {
data/amide-1.0.5/src/amitk_study.c:1082:23:  [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 ((study_file = fopen(study_filename, "rb")) == NULL) {
data/amide-1.0.5/src/amitk_study.c:1209:23:  [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 ((study_file = fopen(study_filename, "wb")) == NULL) {
data/amide-1.0.5/src/dcmtk_interface.cc:61: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).
  if ((file = fopen(filename, "rb")) == NULL)
data/amide-1.0.5/src/dcmtk_interface.cc:696: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(ds_pointer, (guchar *) buffer, format_size*ds->raw_data->dim.x*ds->raw_data->dim.y*ds->raw_data->dim.z);
data/amide-1.0.5/src/dcmtk_interface.cc:733:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(ds_pointer, slice_pointer, num_bytes_to_transfer);
data/amide-1.0.5/src/dcmtk_interface.cc:1816: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.
  const char * record_name[3];
data/amide-1.0.5/src/dcmtk_interface.cc:2151: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 ((void *) &time_structure, (void *) ptm, sizeof(struct tm));
data/amide-1.0.5/src/dcmtk_interface.cc:2197: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 uid[100];
data/amide-1.0.5/src/dcmtk_interface.cc:2712:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	  memcpy(buffer, amitk_raw_data_get_pointer(AMITK_DATA_SET_RAW_DATA(ds), i_voxel), buffer_size);
data/amide-1.0.5/src/fads.c:441:23:  [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_pointer = fopen(output_filename, "w")) == NULL) {
data/amide-1.0.5/src/fads.c:1340:23:  [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_pointer = fopen(output_filename, "w")) == NULL) {
data/amide-1.0.5/src/fads.c:2360:23:  [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_pointer = fopen(output_filename, "w")) == NULL) {
data/amide-1.0.5/src/libmdc_interface.c:786:6:  [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(ds_pointer, conv_pointer+bytes_per_row*(dim.y-i.y-1), format_size*ds->raw_data->dim.x);
data/amide-1.0.5/src/libmdc_interface.c:1172:6:  [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(plane->buf+bytes_per_row*(dim.y-i.y-1), data_ptr, bytes_per_row);
data/amide-1.0.5/src/mpeg_encode.c:317:30:  [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 ((encode->output_file = fopen(output_filename, "wb")) == NULL) {
data/amide-1.0.5/src/mpeg_encode.c:520:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(context->fame_parameters, &default_fame_parameters, sizeof(fame_parameters_t));
data/amide-1.0.5/src/mpeg_encode.c:555:31:  [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 ((context->output_file = fopen(output_filename, "wb")) == NULL) {
data/amide-1.0.5/src/tb_fads.c:387: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).
  if ((file = fopen(filename, "r")) == NULL) {
data/amide-1.0.5/src/tb_profile.c:366:23:  [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_pointer = fopen(save_filename, "w")) == NULL) {
data/amide-1.0.5/src/tb_roi_analysis.c:199:23:  [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_pointer = fopen(save_filename, "w")) == NULL) {
data/amide-1.0.5/attic/amitk_xif_sel.c:1026:25:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
				  (void *)uri_list, strlen((char *)uri_list));
data/amide-1.0.5/attic/amitk_xif_sel.c:1238:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy (something, sys_filename, sizeof (something));
data/amide-1.0.5/attic/amitk_xif_sel.c:1586:7:  [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 (filename) < 1)
data/amide-1.0.5/attic/amitk_xif_sel.c:1713:7:  [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 (fs->fileop_file) < 1)
data/amide-1.0.5/attic/amitk_xif_sel.c:1751: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).
			      0, strlen (fs->fileop_file));
data/amide-1.0.5/attic/amitk_xif_sel.c:1910: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).
  dir_len = strlen (current_dir);
data/amide-1.0.5/attic/amitk_xif_sel.c:1971: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).
      len = strlen (temp_filename);
data/amide-1.0.5/attic/amitk_xif_sel.c:2053: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).
      textPtr += (strlen (textPtr) + 1);
data/amide-1.0.5/attic/amitk_xif_sel.c:2138: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).
	      length = strlen(filename);
data/amide-1.0.5/attic/amitk_xif_sel.c:2198:30:  [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 (rel_path) - strlen (rem_path));
data/amide-1.0.5/attic/amitk_xif_sel.c:2198:50:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                            (strlen (rel_path) - strlen (rem_path));
data/amide-1.0.5/attic/amitk_xif_sel.c:2473:7:  [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 (filename) == 0)
data/amide-1.0.5/attic/amitk_xif_sel.c:2592:36:  [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 (cmpl_state->updated_text[strlen (cmpl_state->updated_text) - 1] != G_DIR_SEPARATOR)
data/amide-1.0.5/attic/amitk_xif_sel.c:2897:43:  [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).
	    *remaining_text = text_to_complete + strlen (text_to_complete);
data/amide-1.0.5/attic/amitk_xif_sel.c:2980:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    cmp_len = strlen (text_to_complete + 1);
data/amide-1.0.5/attic/amitk_xif_sel.c:3002:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy (copy, text_to_complete + 1, cmp_len);
data/amide-1.0.5/attic/amitk_xif_sel.c:3029:50:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  path = g_string_sized_new (dir->fullname_len + strlen (dir_name) + 10);
data/amide-1.0.5/attic/amitk_xif_sel.c:3285: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).
  new_dir->fullname_len = strlen (dir_name);
data/amide-1.0.5/attic/amitk_xif_sel.c:3294: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).
  gint length = strlen (cmpl_dir->fullname);
data/amide-1.0.5/attic/amitk_xif_sel.c:3390: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).
  cmpl_dir->fullname_len = strlen (cmpl_dir->fullname);
data/amide-1.0.5/attic/amitk_xif_sel.c:3530: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).
  length = strlen (text_to_complete) - 1;
data/amide-1.0.5/attic/amitk_xif_sel.c:3622:9:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  len = strlen (text) + strlen (cmpl_state->the_completion.text) + 1;
data/amide-1.0.5/attic/amitk_xif_sel.c:3622:25:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  len = strlen (text) + strlen (cmpl_state->the_completion.text) + 1;
data/amide-1.0.5/attic/amitk_xif_sel.c:3664:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy (pat_buf, *remaining_text, len);
data/amide-1.0.5/attic/amitk_xif_sel.c:3727: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).
  cmpl_len = strlen (cmpl_this_completion (poss));
data/amide-1.0.5/attic/amitk_xif_sel.c:3799:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy (pat_buf, dir->cmpl_text, len);
data/amide-1.0.5/attic/amitk_xif_sel.c:3804:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      gint len = strlen (dir->cmpl_text);
data/amide-1.0.5/attic/amitk_xif_sel.c:3813:2:  [1] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant character.
	strcpy (pat_buf + len, "*");
data/amide-1.0.5/attic/amitk_xif_sel.c:3860:7:  [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 (cmpl_state->completion_dir->fullname) + 1,
data/amide-1.0.5/attic/amitk_xif_sel.c:3896: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).
      len += strlen (utf8);
data/amide-1.0.5/attic/amitk_xif_sel.c:3899: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).
      len += strlen (utf8);
data/amide-1.0.5/attic/amitk_xif_sel.c:3928:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      buf_ptr += strlen (buf_ptr);
data/amide-1.0.5/attic/amitk_xif_sel.c:3937:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      buf_ptr += strlen (buf_ptr);
data/amide-1.0.5/src/amide_gconf.c:423:74:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  return_val = go_conf_win32_set(root, real_key, REG_SZ, (guchar *) str, strlen (str) + 1);
data/amide-1.0.5/src/amide_gconf.c:446:74:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  return_val = go_conf_win32_set(root, real_key, REG_SZ, (guchar *) str, strlen (str) + 1);
data/amide-1.0.5/src/amitk_common.c:256: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).
  length = strlen(filename);
data/amide-1.0.5/src/amitk_common.c:319:52:  [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 (strncmp(magic, AMITK_FLAT_FILE_MAGIC_STRING, strlen(AMITK_FLAT_FILE_MAGIC_STRING)) != 0) {
data/amide-1.0.5/src/amitk_data_set.c:1535:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    raw_filename[strlen(raw_filename)-4] = '\0';
data/amide-1.0.5/src/amitk_study.c:671:7:  [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(suggested_name) == 0)
data/amide-1.0.5/src/amitk_study.c:677:7:  [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(AMITK_OBJECT_NAME(study))) == 0)) 
data/amide-1.0.5/src/amitk_study.c:988:27:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  while ((returned_char = fgetc(study_file)) != EOF) {
data/amide-1.0.5/src/amitk_study.c:996: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).
	if (counter == strlen(amide_data_file_xml_start_tag)) {
data/amide-1.0.5/src/amitk_study.c:1009: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).
	if (counter == strlen(amide_data_file_xml_end_tag)) {
data/amide-1.0.5/src/amitk_study.c:1013: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).
	  start_location -= strlen(amide_data_file_xml_tag)+3;
data/amide-1.0.5/src/amitk_tree_view.c:936:8:  [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 (AMITK_OBJECT_NAME(tree_view->src_object))+1);
data/amide-1.0.5/src/libmdc_interface.c:450:7:  [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(libmdc_fi.study_id) > 0) 
data/amide-1.0.5/src/libmdc_interface.c:455:9:  [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(libmdc_fi.patient_name) > 0)
data/amide-1.0.5/src/libmdc_interface.c:471:7:  [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(libmdc_fi.recon_method) > 0)
data/amide-1.0.5/src/libmdc_interface.c:922:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(fi.patient_name,AMITK_DATA_SET_SUBJECT_NAME(ds), MDC_MAXSTR);
data/amide-1.0.5/src/libmdc_interface.c:924:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(fi.patient_id,AMITK_DATA_SET_SUBJECT_ID(ds), MDC_MAXSTR);
data/amide-1.0.5/src/libmdc_interface.c:926:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(fi.patient_dob,AMITK_DATA_SET_SUBJECT_DOB(ds), MDC_MAXSTR);
data/amide-1.0.5/src/libmdc_interface.c:927:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(fi.patient_sex, amitk_subject_sex_get_name(AMITK_DATA_SET_SUBJECT_SEX(ds)), MDC_MAXSTR);
data/amide-1.0.5/src/ui_common.c:786:9:  [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(*return_str_ptr));
data/amide-1.0.5/src/ui_study.c:1159:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      if (strlen(help_info_lines[which_info][i_line]) > 0) {
data/amide-1.0.5/src/ui_study_cb.c:599: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).
  length = strlen(filename);
data/amide-1.0.5/src/xml.c:565:32:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	temp_str=malloc(sizeof(char)*(strlen(num_str)+1));
data/amide-1.0.5/src/xml.c:568:32:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	temp_str=malloc(sizeof(char)*(strlen(num_str)+strlen(temp_str2)+2));
data/amide-1.0.5/src/xml.c:568:48:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	temp_str=malloc(sizeof(char)*(strlen(num_str)+strlen(temp_str2)+2));
data/amide-1.0.5/src/xml.c:570:2:  [1] (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 character.
	strcat(temp_str, "\t");

ANALYSIS SUMMARY:

Hits = 117
Lines analyzed = 75797 in approximately 1.66 seconds (45620 lines/second)
Physical Source Lines of Code (SLOC) = 52883
Hits@level = [0] 124 [1]  59 [2]  32 [3]   2 [4]  21 [5]   3
Hits@level+ = [0+] 241 [1+] 117 [2+]  58 [3+]  26 [4+]  24 [5+]   3
Hits/KSLOC@level+ = [0+] 4.55723 [1+] 2.21243 [2+] 1.09676 [3+] 0.491651 [4+] 0.453832 [5+] 0.056729
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.