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-gsi-sysconfig-9.2/test/system-config-test.c Examining data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.h Examining data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config_constants.h Examining data/globus-gsi-sysconfig-9.2/library/globus_i_gsi_system_config.h Examining data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config_error.c Examining data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c FINAL RESULTS: data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:663:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer,"%s%s",home_drive,home_path); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:2728:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(file_search_string,"%s\\*.*",ca_cert_dir); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:2846:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(search_string,"%s\\*.*",DEFAULT_SECURE_TMP_DIR); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7336: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(buffer, WIN32_FALLBACK_PATH); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7392:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer,"%s%s",win32_cwd(),"\\share\\certificates"); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7400:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer,"%s%s",win32_cwd(),"\\etc"); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7408:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer,"%s%s",win32_cwd(),"\\etc\\grid-mapfile"); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7416:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer,"%s%s",win32_cwd(),"\\etc\\gsi-authz.conf"); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7424:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer,"%s%s",win32_cwd(),"\\etc\\grid-security\\gsi-gaa.conf"); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7442:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer,"%s\\system32\\drivers\\etc",system_root); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7456:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer,"%s%s",win32_etc(),"\\grid-security\\certificates"); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7464:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer,"%s%s",win32_etc(),"\\grid-security"); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7472:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer,"%s%s",win32_etc(),"\\grid-security\\grid-mapfile"); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7480:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer,"%s%s",win32_etc(),"\\grid-security\\gsi-auth.conf"); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:231:18: [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. tmp_string = getenv("GLOBUS_GSI_SYSCONFIG_DEBUG_LEVEL"); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:242:18: [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. tmp_string = getenv("GLOBUS_GSI_SYSCONFIG_DEBUG_FILE"); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:263:8: [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(getenv("GLOBUS_IGNORE_CRED_PERMS")) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:288:16: [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. egd_path = getenv("EGD_PATH"); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:640:18: [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. home_drive = getenv("HOMEDRIVE"); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:651:17: [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. home_path = getenv("HOMEPATH"); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:1414:15: [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(name = getenv("USERNAME")) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:1533:8: [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(getenv(X509_CERT_DIR)) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:1539:13: [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. getenv(X509_CERT_DIR)); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:1742:12: [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(getenv(X509_USER_CERT)) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:1748:17: [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. getenv(X509_USER_CERT)); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:1796:12: [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(getenv(X509_USER_KEY)) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:1802:17: [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. getenv(X509_USER_KEY)); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:1983:8: [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(getenv(X509_USER_CERT) && getenv(X509_USER_KEY)) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:1983:34: [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(getenv(X509_USER_CERT) && getenv(X509_USER_KEY)) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:1989:13: [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. getenv(X509_USER_CERT)); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:2002:13: [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. getenv(X509_USER_KEY)); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:2261:8: [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(getenv(X509_USER_CERT) && getenv(X509_USER_KEY)) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:2261:34: [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(getenv(X509_USER_CERT) && getenv(X509_USER_KEY)) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:2267:13: [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. getenv(X509_USER_CERT)); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:2281:13: [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. getenv(X509_USER_KEY)); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:2571:21: [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((env_value = getenv(X509_USER_PROXY))) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:2950:33: [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(((gridmap_env = (char *) getenv("GRIDMAP")) != NULL) || data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:2951:33: [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. ((gridmap_env = (char *) getenv("GLOBUSMAP")) != NULL) || data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:2952:33: [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. ((gridmap_env = (char *) getenv("globusmap")) != NULL) || data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:2953:33: [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. ((gridmap_env = (char *) getenv("GlobusMap")) != NULL)) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:3056: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((authz_env = (char *) getenv("GSI_AUTHZ_CONF")) != NULL) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:3232:34: [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((authz_lib_env = (char *) getenv("GSI_AUTHZ_LIB_CONF")) != NULL) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:3416:28: [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((gaa_env = (char *) getenv("GSI_GAA_CONF")) != NULL) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:4903:8: [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(getenv(X509_CERT_DIR)) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:4909:13: [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. getenv(X509_CERT_DIR)); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:5114:12: [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(getenv(X509_USER_CERT)) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:5120:17: [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. getenv(X509_USER_CERT)); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:5168:12: [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(getenv(X509_USER_KEY)) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:5174:17: [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. getenv(X509_USER_KEY)); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:5354:8: [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(getenv(X509_USER_CERT) && getenv(X509_USER_KEY)) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:5354:34: [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(getenv(X509_USER_CERT) && getenv(X509_USER_KEY)) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:5360:13: [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. getenv(X509_USER_CERT)); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:5373:13: [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. getenv(X509_USER_KEY)); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:5632:8: [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(getenv(X509_USER_CERT) && getenv(X509_USER_KEY)) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:5632:34: [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(getenv(X509_USER_CERT) && getenv(X509_USER_KEY)) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:5638:13: [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. getenv(X509_USER_CERT)); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:5652:13: [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. getenv(X509_USER_KEY)); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:5932:21: [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((env_value = getenv(X509_USER_PROXY))) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:6452:33: [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(((gridmap_env = (char *) getenv("GRIDMAP")) != NULL) || data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:6453:33: [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. ((gridmap_env = (char *) getenv("GLOBUSMAP")) != NULL) || data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:6454:33: [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. ((gridmap_env = (char *) getenv("globusmap")) != NULL) || data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:6455:33: [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. ((gridmap_env = (char *) getenv("GlobusMap")) != NULL)) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:6559: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((authz_env = (char *) getenv("GSI_AUTHZ_CONF")) != NULL) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:6735:34: [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((authz_lib_env = (char *) getenv("GSI_AUTHZ_LIB_CONF")) != NULL) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:6914:28: [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((gaa_env = (char *) getenv("GSI_GAA_CONF")) != NULL) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7105:8: [3] (tmpfile) tmpnam: Temporary file race condition (CWE-377). if(tmpnam(unique_tmp_name) == NULL) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7211:22: [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 ((env_value = getenv(X509_VHOST_CRED_DIR)) != NULL) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7358:23: [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. tmp_path = getenv("TMP"); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7359:23: [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. temp_path = getenv("TEMP"); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7439:23: [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. system_root = getenv("SystemRoot"); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:228: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 buffer[200]; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:234:46: [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_gsi_sysconfig_debug_level = atoi(tmp_string); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:245:48: [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_gsi_sysconfig_debug_fstream = fopen(tmp_string, "w"); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:631: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 buffer[256]; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:2703: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 file_search_string[MAX_PATH]; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:2838: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 search_string[MAX_PATH]; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:2839:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char msg[65] = "DESTROYED BY GLOBUS\r\n"; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:6349:24: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char msg[65] data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:6351:45: [2] (misc) open: 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). int f = open(full_filename, O_RDWR); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7085: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 unique_tmp_name[L_tmpnam]; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7327:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[MAX_PATH+1] = {0}; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7355:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[MAX_PATH]; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7391:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[MAX_PATH]; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7399:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[MAX_PATH]; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7407:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[MAX_PATH]; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7415:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[MAX_PATH]; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7423:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[MAX_PATH]; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7437:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[MAX_PATH]; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7447: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(buffer,"c:\\winnt\\system32\\drivers\\etc",system_root); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7455:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[MAX_PATH]; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7463:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[MAX_PATH]; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7471:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[MAX_PATH]; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7479:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[MAX_PATH]; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config_error.c:29: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 * data/globus-gsi-sysconfig-9.2/test/system-config-test.c:142:59: [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). int proxy_file_type = atoi(argv[3]); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:665: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). temp_home_dir = malloc(strlen(buffer) + 1); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:669:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(temp_home_dir, buffer, strlen(buffer) + 1); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:669:40: [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). strncpy(temp_home_dir, buffer, strlen(buffer) + 1); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:1258: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). length = strlen(cwd) + strlen(filename) + 2; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:1258: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). length = strlen(cwd) + strlen(filename) + 2; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:1270: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). length = strlen(filename) + 1; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:1325: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). filename_string_length = strlen(full_filename) + 1; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:1351: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). filename_string_length = strlen(full_filename) - dir_string_length + 1; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:1416:16: [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 = strlen(name) + 1; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:1420:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(*username,name,size); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:2749: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). file_length = strlen(file_data.cFileName); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:2871: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). strlen(X509_UNIQUE_PROXY_FILE))) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:3945: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). *username = malloc(strlen(pwd_result->pw_name) + 1); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:3953:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(*username, pwd_result->pw_name, data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:3954: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). strlen(pwd_result->pw_name) + 1); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:4051: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). length = strlen(cwd) + strlen(filename) + 2; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:4051: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). length = strlen(cwd) + strlen(filename) + 2; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:4063: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). length = strlen(filename) + 1; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:4129: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). filename_string_length = strlen(full_filename) + 1; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:4155: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). filename_string_length = strlen(full_filename) - dir_string_length + 1; data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:4319: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). temp_home_dir = malloc(strlen(pwd_result->pw_dir) + 1); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:4322:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(temp_home_dir, pwd_result->pw_dir, data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:4323: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). strlen(pwd_result->pw_dir) + 1); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:6208: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). file_length = strlen(tmp_entry->d_name); data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:6329: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). strlen(X509_UNIQUE_PROXY_FILE))) data/globus-gsi-sysconfig-9.2/library/globus_gsi_system_config.c:7340:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). buffer[strlen(buffer)-1] = 0; ANALYSIS SUMMARY: Hits = 121 Lines analyzed = 9001 in approximately 0.18 seconds (49315 lines/second) Physical Source Lines of Code (SLOC) = 6354 Hits@level = [0] 27 [1] 26 [2] 25 [3] 56 [4] 14 [5] 0 Hits@level+ = [0+] 148 [1+] 121 [2+] 95 [3+] 70 [4+] 14 [5+] 0 Hits/KSLOC@level+ = [0+] 23.2924 [1+] 19.0431 [2+] 14.9512 [3+] 11.0167 [4+] 2.20334 [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.