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/openvpn-auth-ldap-2.0.4/src/PXObjCRuntime.h Examining data/openvpn-auth-ldap-2.0.4/src/TRAccountRepository.h Examining data/openvpn-auth-ldap-2.0.4/src/TRArray.h Examining data/openvpn-auth-ldap-2.0.4/src/TRAuthLDAPConfig.h Examining data/openvpn-auth-ldap-2.0.4/src/TRAutoreleasePool.h Examining data/openvpn-auth-ldap-2.0.4/src/TRConfig.h Examining data/openvpn-auth-ldap-2.0.4/src/TRConfigLexer.h Examining data/openvpn-auth-ldap-2.0.4/src/TRConfigToken.h Examining data/openvpn-auth-ldap-2.0.4/src/TREnumerator.h Examining data/openvpn-auth-ldap-2.0.4/src/TRHash.h Examining data/openvpn-auth-ldap-2.0.4/src/TRLDAPAccountRepository.h Examining data/openvpn-auth-ldap-2.0.4/src/TRLDAPConnection.h Examining data/openvpn-auth-ldap-2.0.4/src/TRLDAPEntry.h Examining data/openvpn-auth-ldap-2.0.4/src/TRLDAPGroupConfig.h Examining data/openvpn-auth-ldap-2.0.4/src/TRLDAPSearchFilter.h Examining data/openvpn-auth-ldap-2.0.4/src/TRLocalPacketFilter.h Examining data/openvpn-auth-ldap-2.0.4/src/TRLog.h Examining data/openvpn-auth-ldap-2.0.4/src/TRObject.h Examining data/openvpn-auth-ldap-2.0.4/src/TRPFAddress.h Examining data/openvpn-auth-ldap-2.0.4/src/TRPacketFilter.h Examining data/openvpn-auth-ldap-2.0.4/src/TRString.h Examining data/openvpn-auth-ldap-2.0.4/src/TRVPNPlugin.h Examining data/openvpn-auth-ldap-2.0.4/src/TRVPNSession.h Examining data/openvpn-auth-ldap-2.0.4/src/asprintf.c Examining data/openvpn-auth-ldap-2.0.4/src/base64.c Examining data/openvpn-auth-ldap-2.0.4/src/base64.h Examining data/openvpn-auth-ldap-2.0.4/src/hash.c Examining data/openvpn-auth-ldap-2.0.4/src/hash.h Examining data/openvpn-auth-ldap-2.0.4/src/openvpn-cr.c Examining data/openvpn-auth-ldap-2.0.4/src/openvpn-cr.h Examining data/openvpn-auth-ldap-2.0.4/src/strlcpy.c Examining data/openvpn-auth-ldap-2.0.4/src/strlcpy.h Examining data/openvpn-auth-ldap-2.0.4/src/testplugin.c Examining data/openvpn-auth-ldap-2.0.4/src/xmalloc.c Examining data/openvpn-auth-ldap-2.0.4/src/xmalloc.h Examining data/openvpn-auth-ldap-2.0.4/tests/PXTestAssert.h Examining data/openvpn-auth-ldap-2.0.4/tests/PXTestCase.h Examining data/openvpn-auth-ldap-2.0.4/tests/PXTestCaseRunner.h Examining data/openvpn-auth-ldap-2.0.4/tests/PXTestConsoleResultHandler.h Examining data/openvpn-auth-ldap-2.0.4/tests/PXTestException.h Examining data/openvpn-auth-ldap-2.0.4/tests/PXTestObjC.h Examining data/openvpn-auth-ldap-2.0.4/tests/PXTestResultHandler.h Examining data/openvpn-auth-ldap-2.0.4/tests/mockpf.c Examining data/openvpn-auth-ldap-2.0.4/tests/mockpf.h Examining data/openvpn-auth-ldap-2.0.4/tests/tests.h Examining data/openvpn-auth-ldap-2.0.4/tools/lemon.c Examining data/openvpn-auth-ldap-2.0.4/tools/lempar.c Examining data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c FINAL RESULTS: data/openvpn-auth-ldap-2.0.4/src/testplugin.c:84:16: [4] (misc) getpass: This function is obsolete and not portable. It was in SUSv2 but removed by POSIX.2. What it does exactly varies considerably between systems, particularly in where its prompt is displayed and where it gets its data (e.g., /dev/tty, stdin, stderr, etc.). In addition, some implementations overflow buffers. (CWE-676, CWE-120, CWE-20). Make the specific calls to do exactly what you want. If you continue to use it, or write your own, be sure to zero the password as soon as possible to avoid leaving the cleartext password visible in the process' address space. password = getpass("Password: "); data/openvpn-auth-ldap-2.0.4/src/testplugin.c:91: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(data->username, username_template); data/openvpn-auth-ldap-2.0.4/src/testplugin.c:92:5: [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(data->username, username); data/openvpn-auth-ldap-2.0.4/src/testplugin.c:96: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(data->password, password_template); data/openvpn-auth-ldap-2.0.4/src/testplugin.c:97:5: [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(data->password, password); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:26:12: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. extern int access(const char *path, int mode); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:1333:3: [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,format,ap); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:1370:3: [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(*paz, z); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:1381:3: [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(user_outputname, z); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:1390:3: [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(user_templatename, z); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:2729:3: [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(name,filename); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:2732:3: [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(name,suffix); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:2994:16: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. if( path ) sprintf(path,"%s/%s",argv0,name); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:3003:7: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(pathbuf, pathlist); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:3009:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(path,"%s/%s",pathbuf,name); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:3013:13: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if( access(path,modemask)==0 ) break; data/openvpn-auth-ldap-2.0.4/tools/lemon.c:3083:9: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if( access(user_templatename,004)==-1 ){ data/openvpn-auth-ldap-2.0.4/tools/lemon.c:3102:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf,"%s.lt",lemp->filename); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:3104:7: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if( access(buf,004)==0 ){ data/openvpn-auth-ldap-2.0.4/tools/lemon.c:3106:13: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. }else if( access(templatename,004)==0 ){ data/openvpn-auth-ldap-2.0.4/tools/lemon.c:3255:7: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(&z[used], zInt); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:3480:7: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(types[hash],stddt); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:3883:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(line,"\"%s\",",lemp->symbols[i]->name); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:4049:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(pattern,"#define %s%-30s %2d\n",prefix,lemp->symbols[i]->name,i); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:4278: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(cpy,y); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:57:49: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. # define debug0(F,M) if( (F)&debugMask ){ fprintf(stderr,M); } data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:58:49: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. # define debug1(F,M,A) if( (F)&debugMask ){ fprintf(stderr,M,A); } data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:59:49: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. # define debug2(F,M,A,B) if( (F)&debugMask ){ fprintf(stderr,M,A,B); } data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:60:49: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. # define debug3(F,M,A,B,C) if( (F)&debugMask ){ fprintf(stderr,M,A,B,C); } data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:2044:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(pIf->zCondition,"%s(%.*s)",zPrefix,nText,zText); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:2152:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(pInclude->zLabel,"%.*s:%s",nArg,zArg,zIf); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:3190:11: [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( zNew[j], zBuf ); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:2997: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. pathlist = getenv("PATH"); data/openvpn-auth-ldap-2.0.4/src/TRLocalPacketFilter.h:60:15: [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). - (pferror_t) open; data/openvpn-auth-ldap-2.0.4/src/TRPacketFilter.h:59:15: [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). - (pferror_t) open; data/openvpn-auth-ldap-2.0.4/src/base64.c:90:23: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const unsigned char pr2six[256] = data/openvpn-auth-ldap-2.0.4/src/hash.c:851: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. typedef char input_t[256]; data/openvpn-auth-ldap-2.0.4/src/hash.c:885: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(new, str, sz); data/openvpn-auth-ldap-2.0.4/src/openvpn-cr.c:28: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. const char *tokenIndexes[15]; data/openvpn-auth-ldap-2.0.4/src/openvpn-cr.h:8:2: [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 protocol[6]; data/openvpn-auth-ldap-2.0.4/src/openvpn-cr.h:9:2: [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[MAXTOKENLENGTH]; data/openvpn-auth-ldap-2.0.4/src/openvpn-cr.h:10:2: [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 response[MAXTOKENLENGTH]; data/openvpn-auth-ldap-2.0.4/src/testplugin.c:72: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 username[128]; data/openvpn-auth-ldap-2.0.4/tests/mockpf.c:230:5: [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 open(const char *path, int flags, ...) { data/openvpn-auth-ldap-2.0.4/tests/mockpf.c:306:17: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. bcopy(path, anchor, siz - off); data/openvpn-auth-ldap-2.0.4/tests/mockpf.c:411: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(table, &tableNode->table, sizeof(struct pfr_table)); data/openvpn-auth-ldap-2.0.4/tests/mockpf.c:548:29: [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(address, &addressNode->addr, sizeof(struct pfr_addr)); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:1359:15: [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. azDefine = (char **) realloc(azDefine, sizeof(azDefine[0])*nDefine); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:1635:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *set[LISTSIZE]; data/openvpn-auth-ldap-2.0.4/tools/lemon.c:1727:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. (*(void(*)(char *))(op[j].arg))(&argv[i][2]); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:1820:20: [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. (*(void(*)(char *))(op[j].arg))(sv); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:1967:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *alias[MAXRHS]; /* Aliases for each RHS symbol (or NULL) */ data/openvpn-auth-ldap-2.0.4/tools/lemon.c:2343: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 zLine[50]; data/openvpn-auth-ldap-2.0.4/tools/lemon.c:2360:11: [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(zLine, "#line %d ", psp->tokenlineno); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:2370:11: [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(zBuf, zLine, nLine); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:2385: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(zBuf, zNew, nNew); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:2519:8: [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). fp = fopen(ps.filename,"rb"); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:2748:8: [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). fp = fopen(lemp->outname,mode); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:2927:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[20]; data/openvpn-auth-ldap-2.0.4/tools/lemon.c:2929: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(buf,"(%d)",cfp->rp->index); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:3051:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[LINESIZE]; data/openvpn-auth-ldap-2.0.4/tools/lemon.c:3076:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1000]; data/openvpn-auth-ldap-2.0.4/tools/lemon.c:3089:10: [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). in = fopen(user_templatename,"rb"); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:3100:5: [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(buf,"%.*s.lt",(int)(cp-lemp->filename),lemp->filename); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:3117:8: [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). in = fopen(tpltname,"rb"); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:3228:10: [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 empty[1] = { 0 }; data/openvpn-auth-ldap-2.0.4/tools/lemon.c:3233:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char zInt[40]; data/openvpn-auth-ldap-2.0.4/tools/lemon.c:3253:7: [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(zInt, "%d", p1); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:3276:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char used[MAXRHS]; /* True for each RHS element which is used */ data/openvpn-auth-ldap-2.0.4/tools/lemon.c:3282: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 newlinestr[2] = { '\n', '\0' }; data/openvpn-auth-ldap-2.0.4/tools/lemon.c:3583:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[LINESIZE]; data/openvpn-auth-ldap-2.0.4/tools/lemon.c:3599: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). out = fopen(user_outputname, "wb"); data/openvpn-auth-ldap-2.0.4/tools/lemon.c:4040:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[LINESIZE]; data/openvpn-auth-ldap-2.0.4/tools/lemon.c:4041:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pattern[LINESIZE]; data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:596:3: [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(pDecl->zName,"%.*s",nName,zName); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:629:3: [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(pId->zName,"%.*s",nId,zId); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:710:9: [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). pIn = fopen(zFilename,"r"); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:727:10: [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). pOut = fopen(zFilename,"w"); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:2046:7: [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(pIf->zCondition,"%.*s",nText,zText); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:2122:5: [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(pDecl->zDecl,"%.*s\n",pToken->nText,pToken->zText); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:2151:7: [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(pInclude->zFile,"%.*s",nArg,zArg); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:2158:7: [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(pInclude->zFile,"%.*s",nArg,zArg); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:2974: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 zLabel[50]; data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:3146:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char zBuf[1000]; /* A single argument is accumulated here */ data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:3150:8: [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). in = fopen(zFile,"r"); data/openvpn-auth-ldap-2.0.4/src/hash.c:882: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). int sz = strlen(str) + 1; data/openvpn-auth-ldap-2.0.4/src/openvpn-cr.c:19: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). if (strlen(source) >= MAXTOKENLENGTH) data/openvpn-auth-ldap-2.0.4/src/openvpn-cr.c:21:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(destination, source, MAXTOKENLENGTH); data/openvpn-auth-ldap-2.0.4/src/testplugin.c:87: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). username[strlen(username) - 1] = '\0'; data/openvpn-auth-ldap-2.0.4/src/testplugin.c:90:57: [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). data->username = malloc(sizeof(username_template) + strlen(username)); data/openvpn-auth-ldap-2.0.4/src/testplugin.c:95:57: [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). data->password = malloc(sizeof(password_template) + strlen(password)); data/openvpn-auth-ldap-2.0.4/tests/mockpf.c:311: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). for (i = strlen(anchor); i < siz; i++) data/openvpn-auth-ldap-2.0.4/tests/mockpf.c:329: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). for (i = strlen(tbl->pfrt_name); i < PF_TABLE_NAME_SIZE; i++) data/openvpn-auth-ldap-2.0.4/tools/lemon.c:51: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). #define lemonStrlen(X) ((int)strlen(X)) data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:438: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). nByte = strlen(zSrc); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:441:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(zDest,zSrc,nByte); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:465: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). nByte = strlen(zText); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:476:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(&pStr->zText[pStr->nUsed],zText,nByte); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:489:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). n = strlen(z); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:507:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(zName); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:618:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). nId = strlen(zId); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:651:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). nId = strlen(zId); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:731: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). fwrite(zOutput,1,strlen(zOutput),pOut); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:1429: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). StringAppend(&str,zTerm,strlen(zTerm)); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:2036: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). nByte += strlen(zPrefix) + 2; data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:2148:57: [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). pInclude = SafeMalloc( sizeof(Include) + nArg*2 + strlen(zIf) + 10 ); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:2218:39: [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). PushIfMacro("!",pIf->zCondition,strlen(pIf->zCondition),pIf->nLine,0); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:2455:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). i = strlen(pDecl->zDecl) - 1; data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:2830: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). pFile->zHdr, (int)strlen(pFile->zHdr), ""); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:2886:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int n = strlen(z); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:2991: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). pDecl->zIf ? (int)strlen(pDecl->zIf)+1 : 0, data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:2992: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). zDecl ? (int)strlen(zDecl) : 0, data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:3161:11: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc(in); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:3164:15: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc(in); data/openvpn-auth-ldap-2.0.4/tools/makeheaders.c:3172:11: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc(in); ANALYSIS SUMMARY: Hits = 115 Lines analyzed = 14741 in approximately 0.48 seconds (30847 lines/second) Physical Source Lines of Code (SLOC) = 9435 Hits@level = [0] 314 [1] 30 [2] 52 [3] 1 [4] 32 [5] 0 Hits@level+ = [0+] 429 [1+] 115 [2+] 85 [3+] 33 [4+] 32 [5+] 0 Hits/KSLOC@level+ = [0+] 45.469 [1+] 12.1887 [2+] 9.00901 [3+] 3.49762 [4+] 3.39163 [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.