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/globus-ftp-control-9.4/globus_ftp_control_data.c
Examining data/globus-ftp-control-9.4/globus_i_ftp_control.h
Examining data/globus-ftp-control-9.4/globus_ftp_control.h
Examining data/globus-ftp-control-9.4/test/eb_simple_data_test.c
Examining data/globus-ftp-control-9.4/test/connect_test.c
Examining data/globus-ftp-control-9.4/test/get_lingering_close.c
Examining data/globus-ftp-control-9.4/test/simple_control_test.c
Examining data/globus-ftp-control-9.4/test/test_server.c
Examining data/globus-ftp-control-9.4/test/data_test.c
Examining data/globus-ftp-control-9.4/test/outstanding_io_test.c
Examining data/globus-ftp-control-9.4/test/async_control_test.c
Examining data/globus-ftp-control-9.4/test/simple_dir_test.c
Examining data/globus-ftp-control-9.4/test/simple_data_test.c
Examining data/globus-ftp-control-9.4/test/abort_test.c
Examining data/globus-ftp-control-9.4/test/globus_ftp_control_test.h
Examining data/globus-ftp-control-9.4/test/test_common.h
Examining data/globus-ftp-control-9.4/test/test_common.c
Examining data/globus-ftp-control-9.4/test/pipe_test.c
Examining data/globus-ftp-control-9.4/test/globus_ftp_control_test.c
Examining data/globus-ftp-control-9.4/test/connect_disconnect_test.c
Examining data/globus-ftp-control-9.4/globus_ftp_control_layout.c
Examining data/globus-ftp-control-9.4/globus_ftp_control.c
Examining data/globus-ftp-control-9.4/globus_ftp_control_client.c
Examining data/globus-ftp-control-9.4/globus_ftp_control_server.c

FINAL RESULTS:

data/globus-ftp-control-9.4/globus_ftp_control.c:286:9:  [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/globus-ftp-control-9.4/globus_ftp_control.c:327:9:  [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(host, str);
data/globus-ftp-control-9.4/globus_ftp_control_data.c:44: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(dc_handle->magic, GLOBUS_FTP_CONTROL_DATA_MAGIC);          \
data/globus-ftp-control-9.4/globus_ftp_control_data.c:5644:8:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
    if(sscanf(layout_str, "StripedLayout=%s;", name) < 1)
data/globus-ftp-control-9.4/globus_ftp_control_layout.c:52:8:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
    if(sscanf(layout_str, "StripedLayout=%s", name) < 1)
data/globus-ftp-control-9.4/globus_ftp_control_server.c:3194:8:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
    if(sscanf(cmd,"%*s %s",tmp) < 1)
data/globus-ftp-control-9.4/globus_ftp_control_server.c:3801: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(command->eret.string_arg,
data/globus-ftp-control-9.4/globus_ftp_control_server.c:3863:8:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
    if(sscanf(command->noop.raw_command,"%*s %s %s",
data/globus-ftp-control-9.4/test/data_test.c:454: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(test_info->fname, g_tmp_file[0]);
data/globus-ftp-control-9.4/test/data_test.c:567: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(test_info->fname, g_tmp_file[0]);
data/globus-ftp-control-9.4/test/data_test.c:755: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(test_info->fname, g_tmp_file[0]);
data/globus-ftp-control-9.4/test/data_test.c:870: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(test_info->fname, g_tmp_file[0]);
data/globus-ftp-control-9.4/test/data_test.c:1012:9:  [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(test_info->fname, g_tmp_file[ctr]);
data/globus-ftp-control-9.4/test/globus_ftp_control_test.c:142:13:  [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(login_info.hostname, argv[ctr+1]);
data/globus-ftp-control-9.4/test/globus_ftp_control_test.c:156:13:  [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(login_info.login, argv[ctr+1]);
data/globus-ftp-control-9.4/test/globus_ftp_control_test.c:157:13:  [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(login_info.password, argv[ctr+2]);
data/globus-ftp-control-9.4/test/globus_ftp_control_test.c:158:13:  [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(login_info.dir, argv[ctr+3]);
data/globus-ftp-control-9.4/test/test_common.c:239: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(s, ap);
data/globus-ftp-control-9.4/globus_ftp_control_data.c:2924:30:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They 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.
                if((dataip = getenv("GLOBUS_FTP_CLIENT_DATA_IP")) != NULL)
data/globus-ftp-control-9.4/test/data_test.c:225:9:  [3] (tmpfile) tmpnam:
  Temporary file race condition (CWE-377).
        tmpnam(g_test_file);
data/globus-ftp-control-9.4/test/data_test.c:237:9:  [3] (tmpfile) tmpnam:
  Temporary file race condition (CWE-377).
        tmpnam(g_tmp_file[i]);
data/globus-ftp-control-9.4/globus_ftp_control.c:73:37:  [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).
	globus_i_ftp_control_debug_level = atoi(tmp_string);
data/globus-ftp-control-9.4/globus_ftp_control.c:178: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/globus-ftp-control-9.4/globus_ftp_control.c:269: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                                          bs_buf[8192];
data/globus-ftp-control-9.4/globus_ftp_control.c:271: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                                          hostip[30];
data/globus-ftp-control-9.4/globus_ftp_control.c:285:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(&tmp_addr, hostent.h_addr_list[0], sizeof(struct in_addr));
data/globus-ftp-control-9.4/globus_ftp_control.c:348: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(dest, src, sizeof(*src));
data/globus-ftp-control-9.4/globus_ftp_control.c:365: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/globus-ftp-control-9.4/globus_ftp_control.h:681: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                                             serverhost[MAXHOSTNAMELEN];
data/globus-ftp-control-9.4/globus_ftp_control.h:683: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                                             server_buffer[
data/globus-ftp-control-9.4/globus_ftp_control.h:716: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                                        magic[32];
data/globus-ftp-control-9.4/globus_ftp_control_client.c:912: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(&cc_handle->response.response_buffer[response_length],
data/globus-ftp-control-9.4/globus_ftp_control_client.c:950: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(new_buf, 
data/globus-ftp-control-9.4/globus_ftp_control_client.c:958: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(&(cc_handle->response.response_buffer[
data/globus-ftp-control-9.4/globus_ftp_control_client.c:1000: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(cc_handle->response.response_buffer,
data/globus-ftp-control-9.4/globus_ftp_control_client.c:1035: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(cc_handle->response.response_buffer,
data/globus-ftp-control-9.4/globus_ftp_control_client.c:1390:21:  [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(&(out_buf[total_length]),
data/globus-ftp-control-9.4/globus_ftp_control_client.c:1403: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(&(out_buf[total_length]),
data/globus-ftp-control-9.4/globus_ftp_control_client.c:1625: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(dest->response_buffer,
data/globus-ftp-control-9.4/globus_ftp_control_client.c:4573:34:  [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).
    globus_i_ftp_control_devnull=fopen("/dev/null","w"); 
data/globus-ftp-control-9.4/globus_ftp_control_client.c:4575:34:  [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).
    globus_i_ftp_control_devnull=fopen("NUL","w"); 
data/globus-ftp-control-9.4/globus_ftp_control_data.c:2075: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(eof_ent->count, count, sizeof(int) * array_size);
data/globus-ftp-control-9.4/globus_ftp_control_data.c:2110: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(tmp_ent->count, count, sizeof(int) * array_size);
data/globus-ftp-control-9.4/globus_ftp_control_data.c:5484: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                                        strmsg[512];
data/globus-ftp-control-9.4/globus_ftp_control_data.c:5543:9:  [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(strmsg, "StripedLayout=Blocked;BlockSize=%ld;",
data/globus-ftp-control-9.4/globus_ftp_control_data.c:5559:9:  [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(strmsg, "StripedLayout=Partitioned;");
data/globus-ftp-control-9.4/globus_ftp_control_data.c:8154: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                                        remote_host[256];
data/globus-ftp-control-9.4/globus_ftp_control_data.c:8856:13:  [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  tag_str[128];
data/globus-ftp-control-9.4/globus_ftp_control_data.c:8857:13:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
            sprintf(tag_str, "MODE=S TYPE=%c NBYTES=%ld",
data/globus-ftp-control-9.4/globus_ftp_control_data.c:9061: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 tag_str[128];
data/globus-ftp-control-9.4/globus_ftp_control_data.c:9062:17:  [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(tag_str, "MODE=S TYPE=%c NBYTES=%ld",
data/globus-ftp-control-9.4/globus_ftp_control_data.c:9974: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 tag_str[128];
data/globus-ftp-control-9.4/globus_ftp_control_data.c:9975:17:  [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(tag_str, "MODE=E TYPE=%c NBYTES=%ld",
data/globus-ftp-control-9.4/globus_ftp_control_data.c:10470:13:  [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 tag_str[128];
data/globus-ftp-control-9.4/globus_ftp_control_data.c:10471:13:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
            sprintf(tag_str, "MODE=E TYPE=%c NBYTES=%ld",
data/globus-ftp-control-9.4/globus_ftp_control_server.c:542: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                                        cmd[5];
data/globus-ftp-control-9.4/globus_ftp_control_server.c:817: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(dest->spor.host_port,
data/globus-ftp-control-9.4/globus_ftp_control_server.c:1884:21:  [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(cc_handle->auth_info.auth_gssapi_subject,
data/globus-ftp-control-9.4/globus_ftp_control_server.c:1925:29:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
                            strcpy(reply,"235 ADAT=");
data/globus-ftp-control-9.4/globus_ftp_control_server.c:2006:21:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
                    strcpy(reply,"335 ADAT=");
data/globus-ftp-control-9.4/globus_ftp_control_server.c:2392: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(new_buf,
data/globus-ftp-control-9.4/globus_ftp_control_server.c:2666: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(new_buf,
data/globus-ftp-control-9.4/globus_ftp_control_server.c:3253: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(tmp,
data/globus-ftp-control-9.4/globus_ftp_control_server.c:3366:9:  [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(*encoded_reply,"632 ");
data/globus-ftp-control-9.4/globus_ftp_control_server.c:3370:9:  [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(*encoded_reply,"631 ");
data/globus-ftp-control-9.4/globus_ftp_control_server.c:4159: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[10];
data/globus-ftp-control-9.4/test/data_test.c:38: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                                        fname[L_tmpnam];
data/globus-ftp-control-9.4/test/data_test.c:46:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char                             g_test_file[L_tmpnam] = {0};
data/globus-ftp-control-9.4/test/data_test.c:47:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char                             g_tmp_file[TEST_ITERATIONS][L_tmpnam] = {0};
data/globus-ftp-control-9.4/test/data_test.c:216:39:  [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).
                verbose_print_level = atoi(argv[ctr+1]);
data/globus-ftp-control-9.4/test/data_test.c:227: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).
        f = fopen(g_test_file, "w");
data/globus-ftp-control-9.4/test/data_test.c:1150: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                             sys_cmd[1024];
data/globus-ftp-control-9.4/test/data_test.c:1154: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).
        test_info->fout = fopen(test_info->fname, "rb+");
data/globus-ftp-control-9.4/test/data_test.c:1209: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).
        test_info->fout = fopen(test_info->fname, "wb");
data/globus-ftp-control-9.4/test/data_test.c:1265:13:  [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                              sys_cmd[512];
data/globus-ftp-control-9.4/test/data_test.c:1329:26:  [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).
        test_info->fin = fopen(g_test_file, "rb");
data/globus-ftp-control-9.4/test/data_test.c:1420:13:  [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                              sys_cmd[512];
data/globus-ftp-control-9.4/test/data_test.c:1492:26:  [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).
        test_info->fin = fopen(g_test_file, "rb");
data/globus-ftp-control-9.4/test/data_test.c:1577:26:  [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).
        test_info->fin = fopen(g_test_file, "rb");
data/globus-ftp-control-9.4/test/data_test.c:1705:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char buf[BUFSIZ];
data/globus-ftp-control-9.4/test/data_test.c:1708: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).
    sfp = fopen(source, "rb");
data/globus-ftp-control-9.4/test/data_test.c:1714: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).
    dfp = fopen(dest, "wb");
data/globus-ftp-control-9.4/test/data_test.c:1760:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char sbuf[BUFSIZ], dbuf[BUFSIZ];
data/globus-ftp-control-9.4/test/data_test.c:1764: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).
    sfp = fopen(source, "rb");
data/globus-ftp-control-9.4/test/data_test.c:1770: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).
    dfp = fopen(dest, "rb");
data/globus-ftp-control-9.4/test/get_lingering_close.c:136:22:  [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).
            g_port = atoi(argv[++i]);
data/globus-ftp-control-9.4/test/globus_ftp_control_test.c:131:39:  [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).
                verbose_print_level = atoi(argv[ctr+1]);
data/globus-ftp-control-9.4/test/globus_ftp_control_test.c:143:31:  [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).
            login_info.port = atoi(argv[ctr+2]);
data/globus-ftp-control-9.4/test/globus_ftp_control_test.h:78: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                                        login[512];
data/globus-ftp-control-9.4/test/globus_ftp_control_test.h:79: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                                        password[512];
data/globus-ftp-control-9.4/test/globus_ftp_control_test.h:80: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                                        dir[512];
data/globus-ftp-control-9.4/test/globus_ftp_control_test.h:81: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                                        hostname[512];
data/globus-ftp-control-9.4/test/pipe_test.c:344:39:  [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).
                verbose_print_level = atoi(argv[ctr+1]);
data/globus-ftp-control-9.4/test/simple_dir_test.c:74: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                                        portmsg[256];
data/globus-ftp-control-9.4/test/simple_dir_test.c:103:9:  [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(portmsg, "PORT %d,%d,%d,%d,%d,%d\r\n", 
data/globus-ftp-control-9.4/test/test_common.c:130: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(&fake_file->buffer[offset], buf, len);
data/globus-ftp-control-9.4/test/test_common.c:231: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[8192];
data/globus-ftp-control-9.4/globus_ftp_control_client.c:650:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(handle->cc_handle.serverhost, 
data/globus-ftp-control-9.4/globus_ftp_control_client.c:2129:55:  [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).
                                      (globus_size_t) strlen(buf),
data/globus-ftp-control-9.4/globus_ftp_control_client.c:2583:55:  [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).
                                      (globus_size_t) strlen(
data/globus-ftp-control-9.4/globus_ftp_control_client.c:2876: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).
                send_tok.length = strlen(send_tok.value);
data/globus-ftp-control-9.4/globus_ftp_control_client.c:2914: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).
		send_tok.length=strlen(handle->cc_handle.auth_info.
data/globus-ftp-control-9.4/globus_ftp_control_client.c:3048: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).
	    len = strlen((const char *) ftp_response->response_buffer);
data/globus-ftp-control-9.4/globus_ftp_control_client.c:3062: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).
		ftp_response->response_buffer + strlen("335 ADAT="), 
data/globus-ftp-control-9.4/globus_ftp_control_client.c:3181: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).
                len = strlen((char *) ftp_response->response_buffer);
data/globus-ftp-control-9.4/globus_ftp_control_client.c:3195:53:  [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).
                    ftp_response->response_buffer + strlen("235 ADAT="), 
data/globus-ftp-control-9.4/globus_ftp_control_client.c:3312:21:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                    strncpy(handle->cc_handle.serverhost, 
data/globus-ftp-control-9.4/globus_ftp_control_client.c:4479:21:  [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).
    in_buf.length = strlen(cmd);
data/globus-ftp-control-9.4/globus_ftp_control_client.c:4829:54:  [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).
                                     (globus_size_t) strlen(
data/globus-ftp-control-9.4/globus_ftp_control_data.c:5642:34:  [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).
    name = (char *)globus_malloc(strlen(layout_str));
data/globus-ftp-control-9.4/globus_ftp_control_layout.c:50:34:  [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).
    name = (char *)globus_malloc(strlen(layout_str));
data/globus-ftp-control-9.4/globus_ftp_control_server.c:547: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(raw_command);
data/globus-ftp-control-9.4/globus_ftp_control_server.c:600:5:  [1] (buffer) sscanf:
  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.
    sscanf(command->noop.raw_command,"%4s",cmd);
data/globus-ftp-control-9.4/globus_ftp_control_server.c:1768:37:  [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).
                    (globus_size_t) strlen(reply),
data/globus-ftp-control-9.4/globus_ftp_control_server.c:1798:26:  [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(command.adat.string_arg) + 3) * 6 / 8);
data/globus-ftp-control-9.4/globus_ftp_control_server.c:1948: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).
                            (globus_size_t) strlen(reply),
data/globus-ftp-control-9.4/globus_ftp_control_server.c:2172:41:  [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).
                        (globus_size_t) strlen(reply),
data/globus-ftp-control-9.4/globus_ftp_control_server.c:2284:41:  [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).
                        (globus_size_t) strlen(reply),
data/globus-ftp-control-9.4/globus_ftp_control_server.c:2918:55:  [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).
                                      (globus_size_t) strlen((char *) buf),
data/globus-ftp-control-9.4/globus_ftp_control_server.c:3134: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(cmd);
data/globus-ftp-control-9.4/globus_ftp_control_server.c:3148:8:  [1] (buffer) sscanf:
  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.
    if(sscanf(cmd,"%4s",tmp) < 1)
data/globus-ftp-control-9.4/globus_ftp_control_server.c:3251: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).
    globus_assert(strlen(cmd) > unwrapped_token.length);
data/globus-ftp-control-9.4/globus_ftp_control_server.c:3328:21:  [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).
    in_buf.length = strlen(reply)+1;
data/globus-ftp-control-9.4/globus_ftp_control_server.c:3772:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    length = strlen(command->noop.raw_command);
data/globus-ftp-control-9.4/globus_ftp_control_server.c:3836:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    length = strlen(command->noop.raw_command);
data/globus-ftp-control-9.4/globus_ftp_control_server.c:4164:8:  [1] (buffer) sscanf:
  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.
    if(sscanf(command->noop.raw_command,"%*s %7s",tmp) < 1)
data/globus-ftp-control-9.4/test/test_common.c:126: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).
        if(len > strlen(buf))
data/globus-ftp-control-9.4/test/test_common.c:128: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).
            len = strlen(buf);

ANALYSIS SUMMARY:

Hits = 128
Lines analyzed = 31483 in approximately 0.55 seconds (57661 lines/second)
Physical Source Lines of Code (SLOC) = 23825
Hits@level = [0]  78 [1]  31 [2]  76 [3]   3 [4]  18 [5]   0
Hits@level+ = [0+] 206 [1+] 128 [2+]  97 [3+]  21 [4+]  18 [5+]   0
Hits/KSLOC@level+ = [0+] 8.64638 [1+] 5.37251 [2+] 4.07135 [3+] 0.881427 [4+] 0.755509 [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.