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/nbc-1.2.1.r4+dfsg/NXT/NBCCommon.h Examining data/nbc-1.2.1.r4+dfsg/NXT/NXTDefs.h Examining data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h FINAL RESULTS: data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h:14390:13: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. inline void printf(string format, variant value); data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h:14404:13: [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. inline void fprintf(byte handle, string format, variant value); data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h:14418:13: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. inline void sprintf(string & str, string format, variant value); data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h:14422:9: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define printf(_format, _value) { \ data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h:14426:9: [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 fprintf(_handle, _format, _value) { \ data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h:14429:9: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. #define sprintf(_str, _format, _value) { \ data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h:14962:15: [4] (buffer) StrCat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). inline string StrCat(string str1, string str2, string strN); data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h:15181:15: [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). inline string strcat(string & dest, const string & src) { data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h:15183: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 __STRBUFFER__, dest, src data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h:15203: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 __STRBUFFER__, dest, __STRRETVAL__ data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h:15217: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). inline string strcpy(string & dest, const string & src) { data/nbc-1.2.1.r4+dfsg/NXT/NXTDefs.h:4388: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 __frsFRArgs.NewFilename, '_tmp', __frsOldName data/nbc-1.2.1.r4+dfsg/NXT/NXTDefs.h:4635: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 __RLSOutput, __RLSBuffer, __FReadArgs.Buffer data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h:14274:6: [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). byte fopen(string filename, const string mode) { data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h:14667: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). inline int atoi(const string & str) { return StrToNum(str); } data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h:14693:13: [2] (integer) atol: 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). inline long atol(const string & str) { return StrToNum(str); } data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h:15300:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. inline void memcpy(variant dest, variant src, byte num); data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h:15367: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. #define memcpy(_dest, _src, _num) asm { mov _dest, _src } data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h:14201:13: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). inline char fgetc(byte handle) { data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h:14219:9: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define getc(_handle) fgetc(_handle) data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h:14219:23: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define getc(_handle) fgetc(_handle) data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h:14489:12: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). inline int getchar() { data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h:15139:5: [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 idx, str data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h:15167: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). inline int strlen(const string & str) { asm { strlen __RETVAL__, str } } data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h:15167:47: [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). inline int strlen(const string & str) { asm { strlen __RETVAL__, str } } data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h:15200:15: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. inline string strncat(string & dest, const string & src, unsigned int num) { data/nbc-1.2.1.r4+dfsg/NXT/NXCDefs.h:15234:15: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). inline string strncpy(string & dest, const string & src, unsigned int num) { ANALYSIS SUMMARY: Hits = 27 Lines analyzed = 39293 in approximately 1.20 seconds (32709 lines/second) Physical Source Lines of Code (SLOC) = 14749 Hits@level = [0] 0 [1] 9 [2] 5 [3] 0 [4] 13 [5] 0 Hits@level+ = [0+] 27 [1+] 27 [2+] 18 [3+] 13 [4+] 13 [5+] 0 Hits/KSLOC@level+ = [0+] 1.83063 [1+] 1.83063 [2+] 1.22042 [3+] 0.881416 [4+] 0.881416 [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.