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/srm-ifce-1.24.3/src/gfal_srm_ifce.h Examining data/srm-ifce-1.24.3/src/gfal_srm_ifce_internal.h Examining data/srm-ifce-1.24.3/src/gfal_srm_ifce_memory_functions.c Examining data/srm-ifce-1.24.3/src/gfal_srm_ifce_systemtest.c Examining data/srm-ifce-1.24.3/src/gfal_srm_ifce_types.h Examining data/srm-ifce-1.24.3/src/gfal_srm_ifce_unittest.c Examining data/srm-ifce-1.24.3/src/gfal_srm_ifce_unittest.h Examining data/srm-ifce-1.24.3/src/gfal_srm_ifce_unittest_common.c Examining data/srm-ifce-1.24.3/src/gfal_srm_ifce_unittest_srmls.c Examining data/srm-ifce-1.24.3/src/gfal_srm_ifce_version.c Examining data/srm-ifce-1.24.3/src/srmSoapBinding.c Examining data/srm-ifce-1.24.3/src/srm_dependencies.c Examining data/srm-ifce-1.24.3/src/srm_dependencies.h Examining data/srm-ifce-1.24.3/src/srm_ifce_internal.h Examining data/srm-ifce-1.24.3/src/srm_soap.h Examining data/srm-ifce-1.24.3/src/srm_struct_util.c Examining data/srm-ifce-1.24.3/src/srm_util.c Examining data/srm-ifce-1.24.3/src/srm_util.h Examining data/srm-ifce-1.24.3/src/srm_version_wrapper.c Examining data/srm-ifce-1.24.3/src/srmv2_async_wrapper.c Examining data/srm-ifce-1.24.3/src/srmv2_async_wrapper.h Examining data/srm-ifce-1.24.3/src/srmv2_data_transfer_functions.c Examining data/srm-ifce-1.24.3/src/srmv2_data_transfer_functions.h Examining data/srm-ifce-1.24.3/src/srmv2_directory_functions.c Examining data/srm-ifce-1.24.3/src/srmv2_directory_functions.h Examining data/srm-ifce-1.24.3/src/srmv2_discovery_functions.c Examining data/srm-ifce-1.24.3/src/srmv2_discovery_functions.h Examining data/srm-ifce-1.24.3/src/srmv2_permission_functions.c Examining data/srm-ifce-1.24.3/src/srmv2_permission_functions.h Examining data/srm-ifce-1.24.3/src/srmv2_space_management_functions.c Examining data/srm-ifce-1.24.3/src/srmv2_space_management_functions.h Examining data/srm-ifce-1.24.3/src/srmv2_sync_wrapper.c Examining data/srm-ifce-1.24.3/src/srmv2_sync_wrapper.h Examining data/srm-ifce-1.24.3/src/time_utils.h FINAL RESULTS: data/srm-ifce-1.24.3/src/gfal_srm_ifce_systemtest.c:63:2: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. system(command); data/srm-ifce-1.24.3/src/gfal_srm_ifce_systemtest.c:70:2: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. system(globus_url_copy); data/srm-ifce-1.24.3/src/gfal_srm_ifce_systemtest.c:600:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(test_srm_endpoint, "%s:8446/srm/managerv2", srm_host); data/srm-ifce-1.24.3/src/gfal_srm_ifce_systemtest.c:601:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(test_dir, "%s/srm_test", srm_path); data/srm-ifce-1.24.3/src/gfal_srm_ifce_systemtest.c:602:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(test_file1, "%s/test_file1", test_dir); data/srm-ifce-1.24.3/src/gfal_srm_ifce_systemtest.c:603:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(test_file2, "%s/test_file2", test_dir); data/srm-ifce-1.24.3/src/gfal_srm_ifce_systemtest.c:604:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(test_unexisting, "%s/unexisting", test_dir); data/srm-ifce-1.24.3/src/srm_util.c:360:9: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (stderr, actual_format, ap); data/srm-ifce-1.24.3/src/srm_util.c:362:9: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf (context->errbuf, context->errbufsz, actual_format, ap); data/srm-ifce-1.24.3/src/srm_util.c:1361: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(ret, s1); data/srm-ifce-1.24.3/src/srm_util.c:1362:9: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(ret + len_s1, s2); data/srm-ifce-1.24.3/src/gfal_srm_ifce_systemtest.c:581: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. char* srm_host = getenv("SE_HOST_1"); data/srm-ifce-1.24.3/src/gfal_srm_ifce_systemtest.c:589: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. char* srm_path = getenv("SE_SRM_PATH_1"); data/srm-ifce-1.24.3/src/gfal_srm_ifce_systemtest.c:606: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. test_vo = getenv("VO"); data/srm-ifce-1.24.3/src/gfal_srm_ifce_systemtest.c:33: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 test_srm_endpoint[MAX_PATH_LEN + MAX_FILE_NAME_LEN]; data/srm-ifce-1.24.3/src/gfal_srm_ifce_systemtest.c:34: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 test_file1[MAX_PATH_LEN + MAX_FILE_NAME_LEN]; data/srm-ifce-1.24.3/src/gfal_srm_ifce_systemtest.c:35: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 test_file2[MAX_PATH_LEN + MAX_FILE_NAME_LEN]; data/srm-ifce-1.24.3/src/gfal_srm_ifce_systemtest.c:36: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 test_unexisting[MAX_PATH_LEN + MAX_FILE_NAME_LEN]; data/srm-ifce-1.24.3/src/gfal_srm_ifce_systemtest.c:37: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 test_dir[MAX_PATH_LEN + MAX_FILE_NAME_LEN]; data/srm-ifce-1.24.3/src/gfal_srm_ifce_unittest.c:2844: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 errbuff[200]; data/srm-ifce-1.24.3/src/srm_ifce_internal.h:64: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 user_agent[128]; data/srm-ifce-1.24.3/src/srm_util.c:1258:48: [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. if (((*statuses)[i].spacetokens = (char **) calloc ((*statuses)[i].nbspacetokens, sizeof (char *))) == NULL) data/srm-ifce-1.24.3/src/gfal_srm_ifce_systemtest.c:597: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). assert(strlen(srm_path) < MAX_PATH_LEN); data/srm-ifce-1.24.3/src/gfal_srm_ifce_systemtest.c:598: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). assert(strlen(srm_host) < MAX_PATH_LEN); data/srm-ifce-1.24.3/src/gfal_srm_ifce_unittest.c:464:6: [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). n = strlen(test_dir); data/srm-ifce-1.24.3/src/gfal_srm_ifce_unittest.c:466: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). for(i=0;i<n && i<strlen(srmMkdirRequest->SURL);i++) data/srm-ifce-1.24.3/src/srm_dependencies.c:53:9: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep data/srm-ifce-1.24.3/src/srm_util.c:668: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). size = strlen(str); data/srm-ifce-1.24.3/src/srm_util.c:672:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(res, str, size); data/srm-ifce-1.24.3/src/srm_util.c:1326: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). tmp = (char*) malloc (strlen(s) + 1); data/srm-ifce-1.24.3/src/srm_util.c:1356: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_s1 = strlen(s1); data/srm-ifce-1.24.3/src/srm_util.c:1357: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). ret = malloc(len_s1 + strlen(s2) + 1); data/srm-ifce-1.24.3/src/srm_util.c:1379: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). with_trailing_slash, '/', strlen("srm://") + 1); ANALYSIS SUMMARY: Hits = 33 Lines analyzed = 10939 in approximately 0.29 seconds (37205 lines/second) Physical Source Lines of Code (SLOC) = 8211 Hits@level = [0] 17 [1] 11 [2] 8 [3] 3 [4] 11 [5] 0 Hits@level+ = [0+] 50 [1+] 33 [2+] 22 [3+] 14 [4+] 11 [5+] 0 Hits/KSLOC@level+ = [0+] 6.08939 [1+] 4.019 [2+] 2.67933 [3+] 1.70503 [4+] 1.33967 [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.