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-callback-6.1/library/globus_gsi_callback_constants.h Examining data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_gl_internal_err.c Examining data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_utils.h Examining data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_api.c Examining data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_alloc.c Examining data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_gl_internal_err.h Examining data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_policy_evaluator.h Examining data/globus-gsi-callback-6.1/library/oldgaa/rfc1779.c Examining data/globus-gsi-callback-6.1/library/oldgaa/globus_oldgaa_utils.c Examining data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_policy_evaluator.c Examining data/globus-gsi-callback-6.1/library/oldgaa/rfc1779.h Examining data/globus-gsi-callback-6.1/library/oldgaa/globus_oldgaa_utils.h Examining data/globus-gsi-callback-6.1/library/oldgaa/globus_oldgaa.h Examining data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_utils.c Examining data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_release.c Examining data/globus-gsi-callback-6.1/library/globus_i_gsi_callback.h Examining data/globus-gsi-callback-6.1/library/globus_gsi_callback_data.c Examining data/globus-gsi-callback-6.1/library/globus_gsi_callback.h Examining data/globus-gsi-callback-6.1/library/globus_gsi_callback_error.c Examining data/globus-gsi-callback-6.1/library/globus_gsi_callback.c FINAL RESULTS: data/globus-gsi-callback-6.1/library/oldgaa/globus_oldgaa_utils.c:374:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(policy_db->error_str,"error retrieving file %s",policy_db->str); data/globus-gsi-callback-6.1/library/oldgaa/globus_oldgaa_utils.c:411:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(ca_policy_file_path, "%s/%s", cert_dir, ca_policy_filename); data/globus-gsi-callback-6.1/library/oldgaa/globus_oldgaa_utils.c:619:10: [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. rc = sscanf(pcontext->buf + pcontext->index, "%s%n", str, &len); data/globus-gsi-callback-6.1/library/oldgaa/globus_oldgaa_utils.c:990: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(str, tmp_str); data/globus-gsi-callback-6.1/library/oldgaa/globus_oldgaa_utils.c:1101: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(tmp_str, str); /* return the read string */ data/globus-gsi-callback-6.1/library/oldgaa/globus_oldgaa_utils.c:1171: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(str, tmp_str); data/globus-gsi-callback-6.1/library/oldgaa/globus_oldgaa_utils.c:1228: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(tmp_str, str); /* return the read string */ data/globus-gsi-callback-6.1/library/oldgaa/globus_oldgaa_utils.c:1307: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(str, tmp_str); data/globus-gsi-callback-6.1/library/oldgaa/globus_oldgaa_utils.c:1384: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(tmp_str, str); /* return the read string */ data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_policy_evaluator.c:396:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(cond, condition->value); data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_policy_evaluator.c:477:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(cond, condition->value); data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_utils.c:96:33: [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). if (*errstring != NULL) strcpy(*errstring, message); data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_utils.c:166: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(r,s); data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_utils.c:510:15: [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(tmp_str, string); data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_utils.c:520:19: [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(tmp_str + index + 1, data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_utils.c:580:28: [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). if (QUOTING != str[i]) strcpy(new_str, str); data/globus-gsi-callback-6.1/library/oldgaa/globus_oldgaa_utils.c:397: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. cert_dir = getenv("X509_CERT_DIR"); data/globus-gsi-callback-6.1/library/globus_gsi_callback.c:170:45: [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_callback_debug_level = atoi(tmp_string); data/globus-gsi-callback-6.1/library/globus_gsi_callback.c:181:47: [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_callback_debug_fstream = fopen(tmp_string, "a"); data/globus-gsi-callback-6.1/library/globus_gsi_callback.c:1219:30: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). crl_fp = fopen(crl_path, "r"); data/globus-gsi-callback-6.1/library/globus_gsi_callback_error.c:31: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-callback-6.1/library/oldgaa/globus_oldgaa_utils.c:481:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). stream = fopen(filename, open_mode); data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_policy_evaluator.c:475:4: [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 cond[MAX_COND_LENGTH] = {NUL}; data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_policy_evaluator.c:488:12: [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). hr = atoi(hr_str); data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_policy_evaluator.c:493:12: [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). min = atoi(min_str); data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_policy_evaluator.c:498:12: [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). sec = atoi(sec_str); data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_policy_evaluator.c:503:16: [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). cond_hr = atoi(value); data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_policy_evaluator.c:510:17: [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). cond_min = atoi(value); data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_policy_evaluator.c:515:17: [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). cond_sec = atoi(value); data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_policy_evaluator.c:534:16: [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). cond_hr = atoi(value); data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_policy_evaluator.c:541:17: [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). cond_min = atoi(value); data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_policy_evaluator.c:546:17: [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). cond_sec = atoi(value); data/globus-gsi-callback-6.1/library/oldgaa/globus_oldgaa_utils.c:184:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). (*options)->length = strlen(subject); data/globus-gsi-callback-6.1/library/oldgaa/globus_oldgaa_utils.c:368: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). policy_db->error_str = malloc(strlen("error retrieving file ") + data/globus-gsi-callback-6.1/library/oldgaa/globus_oldgaa_utils.c:369: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). strlen(policy_db->str) + 1); data/globus-gsi-callback-6.1/library/oldgaa/globus_oldgaa_utils.c:401:38: [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). ca_policy_file_path = malloc(strlen(cert_dir) + data/globus-gsi-callback-6.1/library/oldgaa/globus_oldgaa_utils.c:402:38: [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(ca_policy_filename) + data/globus-gsi-callback-6.1/library/oldgaa/globus_oldgaa_utils.c:687: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). int i=0, j=1, len = strlen(str); /* j=1 because ignore first ' */ data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_gl_internal_err.h:97: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). write(2, msg, strlen(msg)); \ data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_policy_evaluator.c:853:29: [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). int i,j = *jj, length = strlen(cond); data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_utils.c:95:50: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). *errstring = (char *)realloc(*errstring, strlen(message)+1); data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_utils.c:161: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). slen = strlen(s) + 1; data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_utils.c:497: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). tmp_str = malloc(strlen(string) + strlen(regex)); data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_utils.c:497: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). tmp_str = malloc(strlen(string) + strlen(regex)); data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_utils.c:508: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). after_star = strlen(regex) - index - 1; data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_utils.c:511: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(strlen(tmp_str) > (index + after_star)) data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_utils.c:521: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). string + strlen(string) - after_star); data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_utils.c:562: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). length = strlen(str); data/globus-gsi-callback-6.1/library/oldgaa/oldgaa_utils.c:577:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). new_str = malloc(strlen(str)+1); data/globus-gsi-callback-6.1/library/oldgaa/rfc1779.c:144: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). buffer_len = strlen(rfc1779_string); ANALYSIS SUMMARY: Hits = 50 Lines analyzed = 9820 in approximately 0.25 seconds (39138 lines/second) Physical Source Lines of Code (SLOC) = 5658 Hits@level = [0] 80 [1] 18 [2] 15 [3] 1 [4] 16 [5] 0 Hits@level+ = [0+] 130 [1+] 50 [2+] 32 [3+] 17 [4+] 16 [5+] 0 Hits/KSLOC@level+ = [0+] 22.9763 [1+] 8.83704 [2+] 5.65571 [3+] 3.0046 [4+] 2.82785 [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.