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/libnbcompat-20180822/warn.c Examining data/libnbcompat-20180822/pwcache.c Examining data/libnbcompat-20180822/__glob13.c Examining data/libnbcompat-20180822/sha1.c Examining data/libnbcompat-20180822/regfree.c Examining data/libnbcompat-20180822/mdXhl.c Examining data/libnbcompat-20180822/unvis.c Examining data/libnbcompat-20180822/db/mpool/mpool.c Examining data/libnbcompat-20180822/db/hash/hash.h Examining data/libnbcompat-20180822/db/hash/hash_func.c Examining data/libnbcompat-20180822/db/hash/ndbmdatum.c Examining data/libnbcompat-20180822/db/hash/ndbm.c Examining data/libnbcompat-20180822/db/hash/extern.h Examining data/libnbcompat-20180822/db/hash/hash_log2.c Examining data/libnbcompat-20180822/db/hash/hash.c Examining data/libnbcompat-20180822/db/hash/page.h Examining data/libnbcompat-20180822/db/hash/hash_bigkey.c Examining data/libnbcompat-20180822/db/hash/hash_buf.c Examining data/libnbcompat-20180822/db/hash/hash_page.c Examining data/libnbcompat-20180822/db/recno/rec_search.c Examining data/libnbcompat-20180822/db/recno/rec_get.c Examining data/libnbcompat-20180822/db/recno/rec_delete.c Examining data/libnbcompat-20180822/db/recno/extern.h Examining data/libnbcompat-20180822/db/recno/rec_utils.c Examining data/libnbcompat-20180822/db/recno/rec_close.c Examining data/libnbcompat-20180822/db/recno/rec_seq.c Examining data/libnbcompat-20180822/db/recno/rec_open.c Examining data/libnbcompat-20180822/db/recno/recno.h Examining data/libnbcompat-20180822/db/recno/rec_put.c Examining data/libnbcompat-20180822/db/db/db.c Examining data/libnbcompat-20180822/db/pwrite.c Examining data/libnbcompat-20180822/db/btree/bt_get.c Examining data/libnbcompat-20180822/db/btree/bt_close.c Examining data/libnbcompat-20180822/db/btree/bt_search.c Examining data/libnbcompat-20180822/db/btree/bt_conv.c Examining data/libnbcompat-20180822/db/btree/bt_debug.c Examining data/libnbcompat-20180822/db/btree/bt_split.c Examining data/libnbcompat-20180822/db/btree/bt_delete.c Examining data/libnbcompat-20180822/db/btree/extern.h Examining data/libnbcompat-20180822/db/btree/btree.h Examining data/libnbcompat-20180822/db/btree/bt_seq.c Examining data/libnbcompat-20180822/db/btree/bt_put.c Examining data/libnbcompat-20180822/db/btree/bt_overflow.c Examining data/libnbcompat-20180822/db/btree/bt_page.c Examining data/libnbcompat-20180822/db/btree/bt_utils.c Examining data/libnbcompat-20180822/db/btree/bt_open.c Examining data/libnbcompat-20180822/db/pread.c Examining data/libnbcompat-20180822/unsetenv.c Examining data/libnbcompat-20180822/snprintf.c Examining data/libnbcompat-20180822/err.c Examining data/libnbcompat-20180822/md5hl.c Examining data/libnbcompat-20180822/poll.c Examining data/libnbcompat-20180822/isblank.c Examining data/libnbcompat-20180822/setmode.c Examining data/libnbcompat-20180822/fgetln.c Examining data/libnbcompat-20180822/findenv.c Examining data/libnbcompat-20180822/sha2.c Examining data/libnbcompat-20180822/strdup.c Examining data/libnbcompat-20180822/__unsetenv13.c Examining data/libnbcompat-20180822/sha2hl.c Examining data/libnbcompat-20180822/strlcpy.c Examining data/libnbcompat-20180822/setpassent.c Examining data/libnbcompat-20180822/getopt_long.c Examining data/libnbcompat-20180822/strtoll.c Examining data/libnbcompat-20180822/md5c.c Examining data/libnbcompat-20180822/gettemp.c Examining data/libnbcompat-20180822/lchflags.c Examining data/libnbcompat-20180822/nbcompat/sha2.h Examining data/libnbcompat-20180822/nbcompat/ctype.h Examining data/libnbcompat-20180822/nbcompat/fts.h Examining data/libnbcompat-20180822/nbcompat/md5.h Examining data/libnbcompat-20180822/nbcompat/mpool.h Examining data/libnbcompat-20180822/nbcompat/fnmatch.h Examining data/libnbcompat-20180822/nbcompat/tzfile.h Examining data/libnbcompat-20180822/nbcompat/stdbool.h Examining data/libnbcompat-20180822/nbcompat/assert.h Examining data/libnbcompat-20180822/nbcompat/endian.h Examining data/libnbcompat-20180822/nbcompat/cdefs.h Examining data/libnbcompat-20180822/nbcompat/vis.h Examining data/libnbcompat-20180822/nbcompat/dirent.h Examining data/libnbcompat-20180822/nbcompat/sha1.h Examining data/libnbcompat-20180822/nbcompat/statvfs.h Examining data/libnbcompat-20180822/nbcompat/rmd160.h Examining data/libnbcompat-20180822/nbcompat/regex.h Examining data/libnbcompat-20180822/nbcompat/netdb.h Examining data/libnbcompat-20180822/nbcompat/stdio.h Examining data/libnbcompat-20180822/nbcompat/stdlib.h Examining data/libnbcompat-20180822/nbcompat/db.h Examining data/libnbcompat-20180822/nbcompat/getopt.h Examining data/libnbcompat-20180822/nbcompat/time.h Examining data/libnbcompat-20180822/nbcompat/util.h Examining data/libnbcompat-20180822/nbcompat/poll.h Examining data/libnbcompat-20180822/nbcompat/types.h Examining data/libnbcompat-20180822/nbcompat/param.h Examining data/libnbcompat-20180822/nbcompat/grp.h Examining data/libnbcompat-20180822/nbcompat/termcap.h Examining data/libnbcompat-20180822/nbcompat/limits.h Examining data/libnbcompat-20180822/nbcompat/pwd.h Examining data/libnbcompat-20180822/nbcompat/glob.h Examining data/libnbcompat-20180822/nbcompat/err.h Examining data/libnbcompat-20180822/nbcompat/unistd.h Examining data/libnbcompat-20180822/nbcompat/string.h Examining data/libnbcompat-20180822/nbcompat/paths.h Examining data/libnbcompat-20180822/nbcompat/stat.h Examining data/libnbcompat-20180822/nbcompat/ndbm.h Examining data/libnbcompat-20180822/nbcompat/queue.h Examining data/libnbcompat-20180822/usleep.c Examining data/libnbcompat-20180822/setenv.c Examining data/libnbcompat-20180822/getdelim.c Examining data/libnbcompat-20180822/setgroupent.c Examining data/libnbcompat-20180822/getaddrinfo.c Examining data/libnbcompat-20180822/mkstemp.c Examining data/libnbcompat-20180822/engine.c Examining data/libnbcompat-20180822/fparseln.c Examining data/libnbcompat-20180822/getenv.c Examining data/libnbcompat-20180822/getline.c Examining data/libnbcompat-20180822/setprogname.c Examining data/libnbcompat-20180822/strsep.c Examining data/libnbcompat-20180822/strlcat.c Examining data/libnbcompat-20180822/fnmatch.c Examining data/libnbcompat-20180822/lutimes.c Examining data/libnbcompat-20180822/fts.c Examining data/libnbcompat-20180822/sha1hl.c Examining data/libnbcompat-20180822/lchown.c Examining data/libnbcompat-20180822/lchmod.c Examining data/libnbcompat-20180822/nbcompat.h Examining data/libnbcompat-20180822/asprintf.c Examining data/libnbcompat-20180822/regcomp.c Examining data/libnbcompat-20180822/regexec.c Examining data/libnbcompat-20180822/rmd160.c Examining data/libnbcompat-20180822/timegm.c Examining data/libnbcompat-20180822/vis.c Examining data/libnbcompat-20180822/statvfs.c Examining data/libnbcompat-20180822/private/utils.h Examining data/libnbcompat-20180822/private/regex2.h Examining data/libnbcompat-20180822/private/cclass.h Examining data/libnbcompat-20180822/private/pwcache.h Examining data/libnbcompat-20180822/private/cname.h Examining data/libnbcompat-20180822/shquote.c Examining data/libnbcompat-20180822/regerror.c Examining data/libnbcompat-20180822/strerror.c Examining data/libnbcompat-20180822/glob.c Examining data/libnbcompat-20180822/getopt.c Examining data/libnbcompat-20180822/strmode.c Examining data/libnbcompat-20180822/utimes.c Examining data/libnbcompat-20180822/__fts13.c Examining data/libnbcompat-20180822/rmd160hl.c Examining data/libnbcompat-20180822/mkdtemp.c FINAL RESULTS: data/libnbcompat-20180822/lchmod.c:49:10: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. return (chmod(path, mode)); data/libnbcompat-20180822/lchown.c:49:10: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. return (chown(path, owner, group)); data/libnbcompat-20180822/asprintf.c:78:11: [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. retval = vsnprintf(buf, len, fmt, ap); data/libnbcompat-20180822/asprintf.c:104:11: [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. retval = vsnprintf(buf, len, fmt, ap2); data/libnbcompat-20180822/err.c:70:23: [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. (void)vfprintf(stderr, fmt, ap); data/libnbcompat-20180822/err.c:86:23: [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. (void)vfprintf(stderr, fmt, ap); data/libnbcompat-20180822/err.c:103: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. (void)vfprintf(stderr, fmt, ap); data/libnbcompat-20180822/err.c:118: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. (void)vfprintf(stderr, fmt, ap); data/libnbcompat-20180822/nbcompat/stdio.h:68:5: [4] (format) snprintf: 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. int snprintf(char *, size_t, const char *, ...); data/libnbcompat-20180822/nbcompat/stdio.h:69:5: [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. int vsnprintf(char *, size_t, const char *, va_list); data/libnbcompat-20180822/nbcompat/unistd.h:56:7: [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. char *getpass(const char *); data/libnbcompat-20180822/nbcompat/unistd.h:63:10: [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. # ifndef getpass data/libnbcompat-20180822/nbcompat/unistd.h:64:11: [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. # define getpass getpassphrase data/libnbcompat-20180822/regcomp.c:1409: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). (void) strcpy(cs->multis + oldend - 1, cp); data/libnbcompat-20180822/snprintf.c:43:1: [4] (format) snprintf: 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. snprintf(char *str, size_t size, const char *format, ...) data/libnbcompat-20180822/snprintf.c:49:8: [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. len = vsnprintf(str, size, format, ap); data/libnbcompat-20180822/snprintf.c:55:1: [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(char *str, size_t size, const char *format, va_list ap) data/libnbcompat-20180822/snprintf.c:68:8: [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. len = vfprintf(devnull, format, ap); data/libnbcompat-20180822/snprintf.c:78:2: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. vsprintf(p, format, ap); data/libnbcompat-20180822/warn.c:70:23: [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. (void)vfprintf(stderr, fmt, ap); data/libnbcompat-20180822/warn.c:85:23: [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. (void)vfprintf(stderr, fmt, ap); data/libnbcompat-20180822/warn.c:100: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. (void)vfprintf(stderr, fmt, ap); data/libnbcompat-20180822/warn.c:113: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. (void)vfprintf(stderr, fmt, ap); data/libnbcompat-20180822/__glob13.c:428: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 ((h = getenv("HOME")) == NULL) { data/libnbcompat-20180822/db/btree/bt_open.c:406: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. envtmp = getenv("TMPDIR"); data/libnbcompat-20180822/db/hash/hash_page.c:886: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. envtmp = getenv("TMPDIR"); data/libnbcompat-20180822/getenv.c:74:1: [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(name) data/libnbcompat-20180822/getopt.c:57:14: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. __weak_alias(getopt,_getopt) data/libnbcompat-20180822/getopt.c:76:1: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt(int nargc, char * const nargv[], const char *ostr) data/libnbcompat-20180822/getopt_long.c:64:14: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. __weak_alias(getopt,_getopt) data/libnbcompat-20180822/getopt_long.c:77:14: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. __weak_alias(getopt_long,_getopt_long) data/libnbcompat-20180822/getopt_long.c:84:29: [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. #define IS_POSIXLY_CORRECT (getenv("POSIXLY_CORRECT") != NULL) data/libnbcompat-20180822/getopt_long.c:318:1: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt(nargc, nargv, options) data/libnbcompat-20180822/getopt_long.c:352:1: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt_long(int nargc, char * const *nargv, const char *options, data/libnbcompat-20180822/nbcompat/getopt.h:60:5: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. int getopt_long (int, char * const *, const char *, data/libnbcompat-20180822/__fts13.c:243:44: [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). if (!ISSET(FTS_NOCHDIR) && (sp->fts_rfd = open(".", O_RDONLY, 0)) < 0) data/libnbcompat-20180822/__fts13.c:379:24: [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). if ((p->fts_symfd = open(".", O_RDONLY, 0)) < 0) { data/libnbcompat-20180822/__fts13.c:469:9: [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). open(".", O_RDONLY, 0)) < 0) { data/libnbcompat-20180822/__fts13.c:616:12: [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). if ((fd = open(".", O_RDONLY, 0)) < 0) data/libnbcompat-20180822/__fts13.c:1210:22: [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). if (fd < 0 && (fd = open(path, O_RDONLY)) == -1) data/libnbcompat-20180822/__glob13.c:680: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 buf[MAXPATHLEN]; data/libnbcompat-20180822/__glob13.c:930: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 buf[MAXPATHLEN]; data/libnbcompat-20180822/__glob13.c:954: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 buf[MAXPATHLEN]; data/libnbcompat-20180822/__glob13.c:973: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 buf[MAXPATHLEN]; data/libnbcompat-20180822/db/btree/bt_open.c:204:19: [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). if ((t->bt_fd = open(fname, flags, mode)) == -1) data/libnbcompat-20180822/db/btree/bt_open.c:396: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 path[PATH_MAX]; data/libnbcompat-20180822/db/btree/bt_open.c:398: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 path[MAXPATHLEN]; data/libnbcompat-20180822/db/btree/bt_open.c:415:12: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). if ((fd = mkstemp(path)) != -1) { data/libnbcompat-20180822/db/btree/bt_put.c:78: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 *dest, db[NOVFLSIZE], kb[NOVFLSIZE]; data/libnbcompat-20180822/db/btree/btree.h:140: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 bytes[1]; /* data */ data/libnbcompat-20180822/db/btree/btree.h:201: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 bytes[1]; /* data */ data/libnbcompat-20180822/db/btree/btree.h:246: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 bytes[1]; data/libnbcompat-20180822/db/hash/hash.c:137:20: [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). if ((hashp->fp = open(file, flags, mode)) == -1) data/libnbcompat-20180822/db/hash/hash_page.c:876: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 namestr[PATH_MAX]; data/libnbcompat-20180822/db/hash/hash_page.c:878: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 namestr[MAXPATHLEN]; data/libnbcompat-20180822/db/hash/hash_page.c:895:19: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). if ((hashp->fp = mkstemp(namestr)) != -1) { data/libnbcompat-20180822/db/hash/ndbm.c:63: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 path[MAXPATHLEN]; data/libnbcompat-20180822/db/recno/rec_open.c:73:14: [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). if ((rfd = open(fname, flags, mode)) == -1) data/libnbcompat-20180822/db/recno/rec_put.c:196: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 *dest, db[NOVFLSIZE]; data/libnbcompat-20180822/engine.c:1168: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. static char pbuf[10]; data/libnbcompat-20180822/fparseln.c:106: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/libnbcompat-20180822/fparseln.c:107:56: [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. fparseln(FILE *fp, size_t *size, size_t *lineno, const char str[3], int flags) data/libnbcompat-20180822/fparseln.c:109: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. static const char dstr[3] = { '\\', '\\', '#' }; data/libnbcompat-20180822/fparseln.c:176:10: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy(buf + len, ptr, s); data/libnbcompat-20180822/getaddrinfo.c:54: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 tmpserv[16]; data/libnbcompat-20180822/gettemp.c:89: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. static char xtra[2] = "aa"; data/libnbcompat-20180822/gettemp.c:150:8: [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). open(path, O_CREAT | O_EXCL | O_RDWR, 0600)) >= 0) data/libnbcompat-20180822/md5c.c:130: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 PADDING[64] = { data/libnbcompat-20180822/md5c.c:226:3: [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((POINTER)&context->buffer[idx], data/libnbcompat-20180822/md5c.c:239: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((POINTER)&context->buffer[idx], (POINTER)&input[i], data/libnbcompat-20180822/md5c.c:249:11: [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. unsigned char digest[16]; /* message digest */ data/libnbcompat-20180822/md5c.c:252:11: [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. unsigned char bits[8]; data/libnbcompat-20180822/md5c.c:282:17: [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 unsigned char block[64]; data/libnbcompat-20180822/mdXhl.c:41:11: [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. unsigned char digest[16]; data/libnbcompat-20180822/mdXhl.c:67:11: [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. unsigned char buffer[BUFSIZ]; data/libnbcompat-20180822/mdXhl.c:75:6: [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). f = open(filename, O_RDONLY, 0666); data/libnbcompat-20180822/mkstemp.c:69:1: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). mkstemp(path) data/libnbcompat-20180822/nbcompat/db.h:189: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 _tmp[4]; \ data/libnbcompat-20180822/nbcompat/db.h:190:14: [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. _tmp[0] = ((char *)(void *)a)[0]; \ data/libnbcompat-20180822/nbcompat/db.h:191:14: [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. _tmp[1] = ((char *)(void *)a)[1]; \ data/libnbcompat-20180822/nbcompat/db.h:192:14: [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. _tmp[2] = ((char *)(void *)a)[2]; \ data/libnbcompat-20180822/nbcompat/db.h:193:14: [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. _tmp[3] = ((char *)(void *)a)[3]; \ data/libnbcompat-20180822/nbcompat/db.h:194: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 *)(void *)a)[0] = _tmp[3]; \ data/libnbcompat-20180822/nbcompat/db.h:195: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 *)(void *)a)[1] = _tmp[2]; \ data/libnbcompat-20180822/nbcompat/db.h:196: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 *)(void *)a)[2] = _tmp[1]; \ data/libnbcompat-20180822/nbcompat/db.h:197: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 *)(void *)a)[3] = _tmp[0]; \ data/libnbcompat-20180822/nbcompat/db.h:218: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 _tmp[2]; \ data/libnbcompat-20180822/nbcompat/db.h:219:14: [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. _tmp[0] = ((char *)(void *)a)[0]; \ data/libnbcompat-20180822/nbcompat/db.h:220:14: [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. _tmp[1] = ((char *)(void *)a)[1]; \ data/libnbcompat-20180822/nbcompat/db.h:221: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 *)(void *)a)[0] = _tmp[1]; \ data/libnbcompat-20180822/nbcompat/db.h:222: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 *)(void *)a)[1] = _tmp[0]; \ data/libnbcompat-20180822/nbcompat/fts.h:117: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 fts_name[1]; /* file name */ data/libnbcompat-20180822/nbcompat/md5.h:44:11: [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. unsigned char buffer[64]; /* input buffer */ data/libnbcompat-20180822/nbcompat/netdb.h:59: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 __ss_pad2[_SS_PADSIZE]; data/libnbcompat-20180822/nbcompat/rmd160.h:33:11: [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. unsigned char bbuffer[64]; /* overflow buffer */ data/libnbcompat-20180822/nbcompat/sha1.h:20:11: [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. unsigned char buffer[64]; data/libnbcompat-20180822/nbcompat/sha1.h:24:54: [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 SHA1Transform(uint32_t state[5], const unsigned char buffer[64]); data/libnbcompat-20180822/nbcompat/sha1.h:27:25: [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 SHA1Final(unsigned char digest[20], SHA1_CTX *context); data/libnbcompat-20180822/nbcompat/statvfs.h:103: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 f_fstypename[VFS_NAMELEN]; /* fs type name */ data/libnbcompat-20180822/nbcompat/statvfs.h:104: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 f_mntonname[VFS_MNAMELEN]; /* directory on which mounted */ data/libnbcompat-20180822/nbcompat/statvfs.h:105: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 f_mntfromname[VFS_MNAMELEN]; /* mounted file system */ data/libnbcompat-20180822/nbcompat/stdlib.h:52:5: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). int mkstemp(char *); data/libnbcompat-20180822/nbcompat/util.h:56: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 *fparseln(FILE *, size_t *, size_t *, const char[3], int); data/libnbcompat-20180822/private/pwcache.h:64: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 name[UNMLEN]; /* uid name */ data/libnbcompat-20180822/private/pwcache.h:70: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 name[GNMLEN]; /* gid name */ data/libnbcompat-20180822/private/utils.h:101:26: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define memmove(d, s, c) bcopy(s, d, c) data/libnbcompat-20180822/regcomp.c:181: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. static char nuls[10]; /* place to point scanner in event of error */ data/libnbcompat-20180822/regcomp.c:1034: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 bracket[3]; data/libnbcompat-20180822/regcomp.c:1089: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 bracket[4]; data/libnbcompat-20180822/regcomp.c:1631:8: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void)memcpy(p->strip + p->slen, p->strip + start, data/libnbcompat-20180822/regerror.c:177: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 convbuf[50]; data/libnbcompat-20180822/regexec.c:167:22: [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 ASSIGN(d, s) memcpy(d, s, (size_t)m->g->nstates) data/libnbcompat-20180822/rmd160.c:380:23: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void)memcpy(context->bbuffer + context->buflen, data, nbytes); data/libnbcompat-20180822/rmd160.c:387:23: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void)memcpy(context->bbuffer + context->buflen, data, ofs); data/libnbcompat-20180822/rmd160.c:412:17: [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(context->bbuffer, data + (64 * i) + ofs, context->buflen); data/libnbcompat-20180822/rmd160.c:419:22: [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. RMD160Final(unsigned char digest[20], RMD160_CTX *context) data/libnbcompat-20180822/rmd160hl.c:57:14: [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. unsigned char digest[20]; data/libnbcompat-20180822/rmd160hl.c:78:14: [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. unsigned char buffer[BUFSIZ]; data/libnbcompat-20180822/rmd160hl.c:87: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). if ((fd = open(filename, O_RDONLY)) < 0) data/libnbcompat-20180822/setenv.c:135:4: [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(p, environ, cnt * sizeof(char *)); data/libnbcompat-20180822/sha1.c:47: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(s, d, l) bcopy((d), (s), (l)) data/libnbcompat-20180822/sha1.c:47:26: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define memcpy(s, d, l) bcopy((d), (s), (l)) data/libnbcompat-20180822/sha1.c:85:14: [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. unsigned char c[64]; data/libnbcompat-20180822/sha1.c:153: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. const unsigned char buffer[64]; data/libnbcompat-20180822/sha1.c:167: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. (void)memcpy(block, buffer, 64); data/libnbcompat-20180822/sha1.c:257:8: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void)memcpy(&context->buffer[j], data, (i = 64-j)); data/libnbcompat-20180822/sha1.c:265: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. (void)memcpy(&context->buffer[j], &data[i], len - i); data/libnbcompat-20180822/sha1.c:273:14: [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. unsigned char digest[20]; data/libnbcompat-20180822/sha1.c:277:14: [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. unsigned char finalcount[8]; data/libnbcompat-20180822/sha1hl.c:64:14: [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. unsigned char digest[20]; data/libnbcompat-20180822/sha1hl.c:87:14: [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. unsigned char buffer[BUFSIZ]; data/libnbcompat-20180822/sha1hl.c:96: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). if ((fd = open(filename,O_RDONLY)) < 0) data/libnbcompat-20180822/sha2.c:285: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(context->state, sha256_initial_hash_value, (size_t)(SHA256_DIGEST_LENGTH)); data/libnbcompat-20180822/sha2.c:484:4: [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(&context->buffer[usedspace], data, (size_t)(freespace)); data/libnbcompat-20180822/sha2.c:491:4: [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(&context->buffer[usedspace], data, len); data/libnbcompat-20180822/sha2.c:515:4: [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(context->buffer, data, SHA256_BLOCK_LENGTH); data/libnbcompat-20180822/sha2.c:525:3: [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(context->buffer, data, len); data/libnbcompat-20180822/sha2.c:586:3: [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(d, context->state, SHA256_DIGEST_LENGTH); data/libnbcompat-20180822/sha2.c:600: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(context->state, sha512_initial_hash_value, (size_t)(SHA512_DIGEST_LENGTH)); data/libnbcompat-20180822/sha2.c:792:4: [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(&context->buffer[usedspace], data, (size_t)(freespace)); data/libnbcompat-20180822/sha2.c:799:4: [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(&context->buffer[usedspace], data, len); data/libnbcompat-20180822/sha2.c:823:4: [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(context->buffer, data, SHA512_BLOCK_LENGTH); data/libnbcompat-20180822/sha2.c:833:3: [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(context->buffer, data, len); data/libnbcompat-20180822/sha2.c:902:3: [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(d, context->state, SHA512_DIGEST_LENGTH); data/libnbcompat-20180822/sha2.c:915: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(context->state, sha384_initial_hash_value, (size_t)(SHA512_DIGEST_LENGTH)); data/libnbcompat-20180822/sha2.c:949:3: [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(d, context->state, SHA384_DIGEST_LENGTH); data/libnbcompat-20180822/sha2hl.c:74:11: [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. unsigned char buffer[BUFSIZ * 20]; data/libnbcompat-20180822/sha2hl.c:83:12: [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). if ((fd = open(filename, O_RDONLY)) < 0) data/libnbcompat-20180822/sha2hl.c:99:11: [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. unsigned char digest[SHA256_DIGEST_LENGTH], *d = digest; data/libnbcompat-20180822/sha2hl.c:136:11: [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. unsigned char buffer[BUFSIZ * 20]; data/libnbcompat-20180822/sha2hl.c:144:12: [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). if ((fd = open(filename, O_RDONLY)) < 0) data/libnbcompat-20180822/sha2hl.c:159:11: [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. unsigned char digest[SHA384_DIGEST_LENGTH], *d = digest; data/libnbcompat-20180822/sha2hl.c:182: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/libnbcompat-20180822/sha2hl.c:183:46: [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. SHA384_Data(const uint8_t* data, size_t len, char digest[SHA384_DIGEST_STRING_LENGTH]) data/libnbcompat-20180822/sha2hl.c:196:11: [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. unsigned char buffer[BUFSIZ * 20]; data/libnbcompat-20180822/sha2hl.c:204:12: [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). if ((fd = open(filename, O_RDONLY)) < 0) data/libnbcompat-20180822/sha2hl.c:219:11: [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. unsigned char digest[SHA512_DIGEST_LENGTH], *d = digest; data/libnbcompat-20180822/shquote.c:112:4: [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(buf, outch, outchlen); \ data/libnbcompat-20180822/shquote.c:123: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 outch[MB_LEN_MAX]; data/libnbcompat-20180822/shquote.c:128: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 outch[1]; data/libnbcompat-20180822/snprintf.c:58: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 buf[129]; data/libnbcompat-20180822/snprintf.c:63:13: [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). devnull = fopen("/dev/null", "w"); data/libnbcompat-20180822/snprintf.c:81:3: [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(str, p, MIN(len, size)); data/libnbcompat-20180822/statvfs.c:80: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. (void) memcpy(&vfs->f_fsidx, &sfs->f_fsid, sizeof(fsid_t)); data/libnbcompat-20180822/strdup.c:71: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(copy, str, len); data/libnbcompat-20180822/__fts13.c:190: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). if ((len = strlen(*argv)) == 0) { data/libnbcompat-20180822/__fts13.c:276: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). len = strlen(++cp); data/libnbcompat-20180822/__fts13.c:768:10: [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). dlen = strlen(dp->d_name); data/libnbcompat-20180822/__fts13.c:1187: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). if ((len = strlen(*argv)) > max) data/libnbcompat-20180822/db/btree/bt_open.c:222:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((nr = read(t->bt_fd, &m, sizeof(BTMETA))) < 0) data/libnbcompat-20180822/db/hash/hash.c:155:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). hdrsize = read(hashp->fp, &hashp->hdr, sizeof(HASHHDR)); data/libnbcompat-20180822/db/hash/ndbm.c:71:8: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void)strncpy(path, file, sizeof(path) - 1); data/libnbcompat-20180822/db/hash/ndbm.c:72:8: [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. (void)strncat(path, DBM_SUFFIX, sizeof(path) - strlen(path) - 1); data/libnbcompat-20180822/db/hash/ndbm.c:72:49: [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). (void)strncat(path, DBM_SUFFIX, sizeof(path) - strlen(path) - 1); data/libnbcompat-20180822/db/pread.c:8:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read(fd, buf, nbytes); data/libnbcompat-20180822/db/recno/rec_get.c:141:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((ch = getc(t->bt_rfp)) == EOF || !--len) { data/libnbcompat-20180822/db/recno/rec_get.c:186:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((ch = getc(t->bt_rfp)) == EOF || ch == bval) { data/libnbcompat-20180822/engine.c:207: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). stop = start + strlen(start); data/libnbcompat-20180822/fgetln.c:59:14: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(fp)) != EOF) { data/libnbcompat-20180822/fparseln.c:209: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). len = strlen(buf); data/libnbcompat-20180822/getdelim.c:52:11: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = fgetc(fp); data/libnbcompat-20180822/getopt_long.c:398: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). current_argv_len = strlen(current_argv); data/libnbcompat-20180822/getopt_long.c:406:8: [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(long_options[i].name) == data/libnbcompat-20180822/mdXhl.c:79:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((i = read(f, buffer, sizeof(buffer))) > 0) data/libnbcompat-20180822/poll.c:41:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). fd_set read, write, except; data/libnbcompat-20180822/poll.c:50:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). FD_ZERO(&read); data/libnbcompat-20180822/poll.c:66:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). FD_SET(p[i].fd, &read); data/libnbcompat-20180822/poll.c:75:29: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rval = select(highfd + 1, &read, &write, &except, data/libnbcompat-20180822/poll.c:83:26: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (FD_ISSET(p[i].fd, &read)) data/libnbcompat-20180822/pwcache.c:416: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). if (name == NULL || ((namelen = strlen(name)) == 0)) data/libnbcompat-20180822/pwcache.c:482: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). if (name == NULL || ((namelen = strlen(name)) == 0)) data/libnbcompat-20180822/regcomp.c:260: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). len = strlen(pattern); data/libnbcompat-20180822/regcomp.c:925: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). for (u = cp->multis; *u != '\0'; u += strlen(u) + 1) data/libnbcompat-20180822/regcomp.c:1399: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). cs->smultis += strlen(cp) + 1; data/libnbcompat-20180822/regcomp.c:1430:8: [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(fp); data/libnbcompat-20180822/regcomp.c:1479: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). for (p = cs->multis; *p != '\0'; p += strlen(p) + 1) data/libnbcompat-20180822/regerror.c:200:8: [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(s) + 1; data/libnbcompat-20180822/rmd160hl.c:90:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((num = read(fd, buffer, sizeof(buffer))) > 0) data/libnbcompat-20180822/setenv.c:102: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). l_value = strlen(value); data/libnbcompat-20180822/setenv.c:110: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). if (strlen(c) >= l_value) { /* old larger; copy over */ data/libnbcompat-20180822/setmode.c:216:8: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). (void)umask(mask = umask(0)); data/libnbcompat-20180822/setmode.c:216:21: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). (void)umask(mask = umask(0)); data/libnbcompat-20180822/sha1hl.c:99:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((num = read(fd, buffer, sizeof(buffer))) > 0) data/libnbcompat-20180822/sha2.c:93:32: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. #error Define BYTE_ORDER to be equal to either LITTLE_ENDIAN or BIG_ENDIAN data/libnbcompat-20180822/sha2hl.c:86:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((num = read(fd, buffer, sizeof(buffer))) > 0) data/libnbcompat-20180822/sha2hl.c:147:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((num = read(fd, buffer, sizeof(buffer))) > 0) data/libnbcompat-20180822/sha2hl.c:207:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((num = read(fd, buffer, sizeof(buffer))) > 0) data/libnbcompat-20180822/strdup.c:68:8: [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(str) + 1; data/libnbcompat-20180822/strlcat.c:80: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). return(dlen + strlen(s)); data/libnbcompat-20180822/usleep.c:35:1: [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(unsigned int usec) ANALYSIS SUMMARY: Hits = 210 Lines analyzed = 30437 in approximately 0.97 seconds (31263 lines/second) Physical Source Lines of Code (SLOC) = 18358 Hits@level = [0] 136 [1] 45 [2] 130 [3] 12 [4] 21 [5] 2 Hits@level+ = [0+] 346 [1+] 210 [2+] 165 [3+] 35 [4+] 23 [5+] 2 Hits/KSLOC@level+ = [0+] 18.8474 [1+] 11.4392 [2+] 8.98791 [3+] 1.90653 [4+] 1.25286 [5+] 0.108944 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.