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/9base-6/mtime/mtime.c Examining data/9base-6/unutf/unutf.c Examining data/9base-6/ed/ed.c Examining data/9base-6/cmp/cmp.c Examining data/9base-6/echo/echo.c Examining data/9base-6/fortune/fortune.c Examining data/9base-6/pbd/pbd.c Examining data/9base-6/hoc/math.c Examining data/9base-6/hoc/code.c Examining data/9base-6/hoc/init.c Examining data/9base-6/hoc/symbol.c Examining data/9base-6/hoc/hoc.h Examining data/9base-6/uniq/uniq.c Examining data/9base-6/join/join.c Examining data/9base-6/cal/cal.c Examining data/9base-6/test/test.c Examining data/9base-6/touch/touch.c Examining data/9base-6/du/du.c Examining data/9base-6/strings/strings.c Examining data/9base-6/dd/dd.c Examining data/9base-6/diff/diffio.c Examining data/9base-6/diff/diffreg.c Examining data/9base-6/diff/diffdir.c Examining data/9base-6/diff/main.c Examining data/9base-6/diff/diff.h Examining data/9base-6/cat/cat.c Examining data/9base-6/look/look.c Examining data/9base-6/seq/seq.c Examining data/9base-6/ls/ls.c Examining data/9base-6/sleep/sleep.c Examining data/9base-6/primes/primes.c Examining data/9base-6/yacc/yacc.c Examining data/9base-6/cleanname/cleanname.c Examining data/9base-6/basename/basename.c Examining data/9base-6/freq/freq.c Examining data/9base-6/rc/trap.c Examining data/9base-6/rc/getflags.c Examining data/9base-6/rc/simple.c Examining data/9base-6/rc/fmtquote.c Examining data/9base-6/rc/code.c Examining data/9base-6/rc/pfnc.c Examining data/9base-6/rc/var.c Examining data/9base-6/rc/pcmd.c Examining data/9base-6/rc/getflags.h Examining data/9base-6/rc/subr.c Examining data/9base-6/rc/glob.c Examining data/9base-6/rc/havefork.c Examining data/9base-6/rc/exec.c Examining data/9base-6/rc/haventfork.c Examining data/9base-6/rc/lex.c Examining data/9base-6/rc/exec.h Examining data/9base-6/rc/tree.c Examining data/9base-6/rc/rc.h Examining data/9base-6/rc/io.h Examining data/9base-6/rc/here.c Examining data/9base-6/rc/io.c Examining data/9base-6/rc/unixcrap.c Examining data/9base-6/rc/fns.h Examining data/9base-6/rc/plan9ish.c Examining data/9base-6/awk/lex.c Examining data/9base-6/awk/parse.c Examining data/9base-6/awk/proto.h Examining data/9base-6/awk/tran.c Examining data/9base-6/awk/run.c Examining data/9base-6/awk/proctab.c Examining data/9base-6/awk/maketab.c Examining data/9base-6/awk/main.c Examining data/9base-6/awk/re.c Examining data/9base-6/awk/lib.c Examining data/9base-6/awk/awk.h Examining data/9base-6/lib9/atexit.c Examining data/9base-6/lib9/read9pmsg.c Examining data/9base-6/lib9/lib9.h Examining data/9base-6/lib9/atoi.c Examining data/9base-6/lib9/convM2D.c Examining data/9base-6/lib9/pipe.c Examining data/9base-6/lib9/regexp.h Examining data/9base-6/lib9/lock.c Examining data/9base-6/lib9/lrand.c Examining data/9base-6/lib9/fmtlock2.c Examining data/9base-6/lib9/dup.c Examining data/9base-6/lib9/sysfatal.c Examining data/9base-6/lib9/unsharp.c Examining data/9base-6/lib9/netcrypt.c Examining data/9base-6/lib9/searchpath.c Examining data/9base-6/lib9/lnrand.c Examining data/9base-6/lib9/debugmalloc.c Examining data/9base-6/lib9/_p9dialparse.c Examining data/9base-6/lib9/jmp.c Examining data/9base-6/lib9/pin.c Examining data/9base-6/lib9/qlock.c Examining data/9base-6/lib9/time.c Examining data/9base-6/lib9/post9p.c Examining data/9base-6/lib9/get9root.c Examining data/9base-6/lib9/dirread.c Examining data/9base-6/lib9/getcallerpc-ppc.c Examining data/9base-6/lib9/getns.c Examining data/9base-6/lib9/getuser.c Examining data/9base-6/lib9/nrand.c Examining data/9base-6/lib9/cleanname.c Examining data/9base-6/lib9/sendfd.c Examining data/9base-6/lib9/sec/os.h Examining data/9base-6/lib9/sec/libsec.h Examining data/9base-6/lib9/sec/md5pickle.c Examining data/9base-6/lib9/sec/sha1pickle.c Examining data/9base-6/lib9/sec/md5.c Examining data/9base-6/lib9/sec/sha1.c Examining data/9base-6/lib9/sec/md5block.c Examining data/9base-6/lib9/sec/sha1block.c Examining data/9base-6/lib9/nan.c Examining data/9base-6/lib9/u.h Examining data/9base-6/lib9/bio/bputc.c Examining data/9base-6/lib9/bio/bprint.c Examining data/9base-6/lib9/bio/bflush.c Examining data/9base-6/lib9/bio/bgetc.c Examining data/9base-6/lib9/bio/bfildes.c Examining data/9base-6/lib9/bio/bvprint.c Examining data/9base-6/lib9/bio/bputrune.c Examining data/9base-6/lib9/bio/bgetd.c Examining data/9base-6/lib9/bio/brdline.c Examining data/9base-6/lib9/bio/brdstr.c Examining data/9base-6/lib9/bio/bseek.c Examining data/9base-6/lib9/bio/bread.c Examining data/9base-6/lib9/bio/boffset.c Examining data/9base-6/lib9/bio/bbuffered.c Examining data/9base-6/lib9/bio/bcat.c Examining data/9base-6/lib9/bio/_lib9.h Examining data/9base-6/lib9/bio/bgetrune.c Examining data/9base-6/lib9/bio/lib9.std.h Examining data/9base-6/lib9/bio/bwrite.c Examining data/9base-6/lib9/bio/binit.c Examining data/9base-6/lib9/ctime.c Examining data/9base-6/lib9/strdup.c Examining data/9base-6/lib9/dirstat.c Examining data/9base-6/lib9/syslog.c Examining data/9base-6/lib9/u16.c Examining data/9base-6/lib9/testfork.c Examining data/9base-6/lib9/getcallerpc-x86_64.c Examining data/9base-6/lib9/priv.c Examining data/9base-6/lib9/truerand.c Examining data/9base-6/lib9/getnetconn.c Examining data/9base-6/lib9/_p9translate.c Examining data/9base-6/lib9/write.c Examining data/9base-6/lib9/mallocz.c Examining data/9base-6/lib9/atnotify.c Examining data/9base-6/lib9/tokenize.c Examining data/9base-6/lib9/testfmt.c Examining data/9base-6/lib9/zoneinfo.c Examining data/9base-6/lib9/postnote.c Examining data/9base-6/lib9/testprint.c Examining data/9base-6/lib9/opentemp.c Examining data/9base-6/lib9/regex/regaux.c Examining data/9base-6/lib9/regex/rregexec.c Examining data/9base-6/lib9/regex/lib9.h Examining data/9base-6/lib9/regex/regsub.c Examining data/9base-6/lib9/regex/test2.c Examining data/9base-6/lib9/regex/regerror.c Examining data/9base-6/lib9/regex/regcomp.c Examining data/9base-6/lib9/regex/rregsub.c Examining data/9base-6/lib9/regex/regexec.c Examining data/9base-6/lib9/regex/regcomp.h Examining data/9base-6/lib9/regex/test.c Examining data/9base-6/lib9/regex/lib9.std.h Examining data/9base-6/lib9/exec.c Examining data/9base-6/lib9/cistrcmp.c Examining data/9base-6/lib9/convD2M.c Examining data/9base-6/lib9/dirfstat.c Examining data/9base-6/lib9/fork.c Examining data/9base-6/lib9/quote.c Examining data/9base-6/lib9/dirmodefmt.c Examining data/9base-6/lib9/nulldir.c Examining data/9base-6/lib9/strecpy.c Examining data/9base-6/lib9/cistrncmp.c Examining data/9base-6/lib9/atoll.c Examining data/9base-6/lib9/getcallerpc-power.c Examining data/9base-6/lib9/fmt.h Examining data/9base-6/lib9/regexp9.h Examining data/9base-6/lib9/main.c Examining data/9base-6/lib9/wait.c Examining data/9base-6/lib9/crypt.c Examining data/9base-6/lib9/rand.c Examining data/9base-6/lib9/argv0.c Examining data/9base-6/lib9/readn.c Examining data/9base-6/lib9/malloc.c Examining data/9base-6/lib9/nan.h Examining data/9base-6/lib9/utf.h Examining data/9base-6/lib9/date.c Examining data/9base-6/lib9/rfork.c Examining data/9base-6/lib9/dirwstat.c Examining data/9base-6/lib9/sysname.c Examining data/9base-6/lib9/zoneinfo.h Examining data/9base-6/lib9/encodefmt.c Examining data/9base-6/lib9/needsrcquote.c Examining data/9base-6/lib9/seek.c Examining data/9base-6/lib9/utf/lib9.h Examining data/9base-6/lib9/utf/utfecpy.c Examining data/9base-6/lib9/utf/runestrlen.c Examining data/9base-6/lib9/utf/runestrecpy.c Examining data/9base-6/lib9/utf/runestrchr.c Examining data/9base-6/lib9/utf/utfnlen.c Examining data/9base-6/lib9/utf/runestrncmp.c Examining data/9base-6/lib9/utf/rune.c Examining data/9base-6/lib9/utf/runetype.c Examining data/9base-6/lib9/utf/utfrrune.c Examining data/9base-6/lib9/utf/runestrcpy.c Examining data/9base-6/lib9/utf/runestrncat.c Examining data/9base-6/lib9/utf/runestrstr.c Examining data/9base-6/lib9/utf/plan9.h Examining data/9base-6/lib9/utf/utflen.c Examining data/9base-6/lib9/utf/runestrcat.c Examining data/9base-6/lib9/utf/runestrdup.c Examining data/9base-6/lib9/utf/utfutf.c Examining data/9base-6/lib9/utf/utfrune.c Examining data/9base-6/lib9/utf/runestrcmp.c Examining data/9base-6/lib9/utf/runestrrchr.c Examining data/9base-6/lib9/utf/runestrncpy.c Examining data/9base-6/lib9/utf/utfdef.h Examining data/9base-6/lib9/libc.h Examining data/9base-6/lib9/getcallerpc-PowerMacintosh.c Examining data/9base-6/lib9/getcallerpc-386.c Examining data/9base-6/lib9/errstr.c Examining data/9base-6/lib9/malloctag.c Examining data/9base-6/lib9/readcons.c Examining data/9base-6/lib9/needstack.c Examining data/9base-6/lib9/notify.c Examining data/9base-6/lib9/u64.c Examining data/9base-6/lib9/announce.c Examining data/9base-6/lib9/bio.h Examining data/9base-6/lib9/await.c Examining data/9base-6/lib9/sleep.c Examining data/9base-6/lib9/dirfwstat.c Examining data/9base-6/lib9/u32.c Examining data/9base-6/lib9/fcall.h Examining data/9base-6/lib9/getcallerpc-arm.c Examining data/9base-6/lib9/fcallfmt.c Examining data/9base-6/lib9/testfltfmt.c Examining data/9base-6/lib9/atol.c Examining data/9base-6/lib9/test.c Examining data/9base-6/lib9/convM2S.c Examining data/9base-6/lib9/execl.c Examining data/9base-6/lib9/getfields.c Examining data/9base-6/lib9/netmkaddr.c Examining data/9base-6/lib9/waitpid.c Examining data/9base-6/lib9/_p9dir.c Examining data/9base-6/lib9/_exits.c Examining data/9base-6/lib9/tm2sec.c Examining data/9base-6/lib9/convS2M.c Examining data/9base-6/lib9/exitcode.c Examining data/9base-6/lib9/getenv.c Examining data/9base-6/lib9/fmt/runevsnprint.c Examining data/9base-6/lib9/fmt/print.c Examining data/9base-6/lib9/fmt/pow10.c Examining data/9base-6/lib9/fmt/fmtlock.c Examining data/9base-6/lib9/fmt/fmtquote.c Examining data/9base-6/lib9/fmt/fltfmt.c Examining data/9base-6/lib9/fmt/fmtfdflush.c Examining data/9base-6/lib9/fmt/test2.c Examining data/9base-6/lib9/fmt/fprint.c Examining data/9base-6/lib9/fmt/sprint.c Examining data/9base-6/lib9/fmt/fmtdef.h Examining data/9base-6/lib9/fmt/strtod.c Examining data/9base-6/lib9/fmt/fmtnull.c Examining data/9base-6/lib9/fmt/errfmt.c Examining data/9base-6/lib9/fmt/runesnprint.c Examining data/9base-6/lib9/fmt/vfprint.c Examining data/9base-6/lib9/fmt/runesprint.c Examining data/9base-6/lib9/fmt/snprint.c Examining data/9base-6/lib9/fmt/charstod.c Examining data/9base-6/lib9/fmt/nan.h Examining data/9base-6/lib9/fmt/runesmprint.c Examining data/9base-6/lib9/fmt/fmtlocale.c Examining data/9base-6/lib9/fmt/fmtstr.c Examining data/9base-6/lib9/fmt/fmtprint.c Examining data/9base-6/lib9/fmt/fmt.c Examining data/9base-6/lib9/fmt/test3.c Examining data/9base-6/lib9/fmt/runefmtstr.c Examining data/9base-6/lib9/fmt/vseprint.c Examining data/9base-6/lib9/fmt/plan9.h Examining data/9base-6/lib9/fmt/fmtvprint.c Examining data/9base-6/lib9/fmt/runevsmprint.c Examining data/9base-6/lib9/fmt/vsnprint.c Examining data/9base-6/lib9/fmt/dofmt.c Examining data/9base-6/lib9/fmt/smprint.c Examining data/9base-6/lib9/fmt/seprint.c Examining data/9base-6/lib9/fmt/strtod.h Examining data/9base-6/lib9/fmt/dorfmt.c Examining data/9base-6/lib9/fmt/vsmprint.c Examining data/9base-6/lib9/fmt/fmtfd.c Examining data/9base-6/lib9/fmt/nan64.c Examining data/9base-6/lib9/fmt/runevseprint.c Examining data/9base-6/lib9/fmt/test.c Examining data/9base-6/lib9/fmt/runeseprint.c Examining data/9base-6/lib9/fmt/fmtrune.c Examining data/9base-6/lib9/getwd.c Examining data/9base-6/lib9/dial.c Examining data/9base-6/lib9/cistrstr.c Examining data/9base-6/lib9/udp.c Examining data/9base-6/lib9/create.c Examining data/9base-6/lib9/open.c Examining data/9base-6/sed/sed.c Examining data/9base-6/troff/n2.c Examining data/9base-6/troff/n9.c Examining data/9base-6/troff/n7.c Examining data/9base-6/troff/t6.c Examining data/9base-6/troff/t10.c Examining data/9base-6/troff/n5.c Examining data/9base-6/troff/hytab.c Examining data/9base-6/troff/mbwc.c Examining data/9base-6/troff/tdef.h Examining data/9base-6/troff/n4.c Examining data/9base-6/troff/ext.h Examining data/9base-6/troff/n3.c Examining data/9base-6/troff/t11.c Examining data/9base-6/troff/ni.c Examining data/9base-6/troff/dwbinit.h Examining data/9base-6/troff/suftab.c Examining data/9base-6/troff/dwbinit.c Examining data/9base-6/troff/n1.c Examining data/9base-6/troff/n6.c Examining data/9base-6/troff/n8.c Examining data/9base-6/troff/mbwc.h Examining data/9base-6/troff/n10.c Examining data/9base-6/troff/fns.h Examining data/9base-6/getflags/getflags.c Examining data/9base-6/dc/dc.c Examining data/9base-6/read/read.c Examining data/9base-6/mkdir/mkdir.c Examining data/9base-6/ascii/ascii.c Examining data/9base-6/grep/grep.h Examining data/9base-6/grep/sub.c Examining data/9base-6/grep/main.c Examining data/9base-6/grep/comp.c Examining data/9base-6/sam/list.c Examining data/9base-6/sam/errors.h Examining data/9base-6/sam/multi.c Examining data/9base-6/sam/buff.c Examining data/9base-6/sam/util.c Examining data/9base-6/sam/shell.c Examining data/9base-6/sam/sam.h Examining data/9base-6/sam/plumb.h Examining data/9base-6/sam/parse.h Examining data/9base-6/sam/sys.c Examining data/9base-6/sam/plan9.c Examining data/9base-6/sam/file.c Examining data/9base-6/sam/moveto.c Examining data/9base-6/sam/string.c Examining data/9base-6/sam/rasp.c Examining data/9base-6/sam/address.c Examining data/9base-6/sam/cmd.c Examining data/9base-6/sam/sam.c Examining data/9base-6/sam/_libc.h Examining data/9base-6/sam/unix.c Examining data/9base-6/sam/regexp.c Examining data/9base-6/sam/xec.c Examining data/9base-6/sam/error.c Examining data/9base-6/sam/io.c Examining data/9base-6/sam/mesg.h Examining data/9base-6/sam/mesg.c Examining data/9base-6/sam/disk.c Examining data/9base-6/tail/tail.c Examining data/9base-6/split/split.c Examining data/9base-6/date/date.c Examining data/9base-6/factor/factor.c Examining data/9base-6/unicode/unicode.c Examining data/9base-6/tee/tee.c Examining data/9base-6/fmt/fmt.c Examining data/9base-6/sha1sum/sha1sum.c Examining data/9base-6/tr/tr.c Examining data/9base-6/mk/sys.std.h Examining data/9base-6/mk/shell.c Examining data/9base-6/mk/archive.c Examining data/9base-6/mk/varsub.c Examining data/9base-6/mk/var.c Examining data/9base-6/mk/sh.c Examining data/9base-6/mk/rc.c Examining data/9base-6/mk/graph.c Examining data/9base-6/mk/arc.c Examining data/9base-6/mk/rule.c Examining data/9base-6/mk/symtab.c Examining data/9base-6/mk/lex.c Examining data/9base-6/mk/shprint.c Examining data/9base-6/mk/parse.c Examining data/9base-6/mk/file.c Examining data/9base-6/mk/mk.c Examining data/9base-6/mk/run.c Examining data/9base-6/mk/match.c Examining data/9base-6/mk/main.c Examining data/9base-6/mk/bufblock.c Examining data/9base-6/mk/recipe.c Examining data/9base-6/mk/mk.h Examining data/9base-6/mk/job.c Examining data/9base-6/mk/unix.c Examining data/9base-6/mk/sys.h Examining data/9base-6/mk/word.c Examining data/9base-6/mk/env.c Examining data/9base-6/mk/fns.h Examining data/9base-6/sort/sort.c FINAL RESULTS: data/9base-6/lib9/dirwstat.c:17:6: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. if(chmod(file, dir->mode) < 0) data/9base-6/awk/awk.h:18:30: [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 dprintf(x) if (dbg) printf x data/9base-6/awk/lib.c:187:2: [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(inputFS, *FS); /* for subsequent field splitting */ data/9base-6/awk/lib.c:429:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(fr, rec); data/9base-6/awk/lib.c:489:2: [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, fmt, varg); data/9base-6/awk/lib.c:543:2: [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, fmt, varg); data/9base-6/awk/lib.c:559:2: [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, fmt, varg); data/9base-6/awk/maketab.c:134:7: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. n = sscanf(buf, "%1c %s %s %d", &c, def, name, &tok); data/9base-6/awk/maketab.c:142: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(names[tok-FIRSTTOKEN], name); data/9base-6/awk/proto.h:178:14: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. extern FILE *popen(const char *, const char *); data/9base-6/awk/run.c:461: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(buf, s); data/9base-6/awk/run.c:463:4: [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(buf, *SUBSEP); data/9base-6/awk/run.c:508:4: [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(buf, s); data/9base-6/awk/run.c:510: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(buf, *SUBSEP); data/9base-6/awk/run.c:547: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(buf, s); data/9base-6/awk/run.c:550:4: [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(buf, *SUBSEP); data/9base-6/awk/run.c:881:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. case 0: sprintf(p, "%s", fmt); /* unknown, so dump it too */ data/9base-6/awk/run.c:888:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(p, "%s", t); data/9base-6/awk/run.c:890:11: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. case 1: sprintf(p, fmt, getfval(x)); break; data/9base-6/awk/run.c:891:11: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. case 2: sprintf(p, fmt, (long) getfval(x)); break; data/9base-6/awk/run.c:892:11: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. case 3: sprintf(p, fmt, (int) getfval(x)); break; data/9base-6/awk/run.c:900:4: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(p, fmt, t); data/9base-6/awk/run.c:905:6: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(p, fmt, (int) getfval(x)); data/9base-6/awk/run.c:911:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(p, fmt, getsval(x)[0]); data/9base-6/awk/run.c:1145:2: [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(s, x->sval); data/9base-6/awk/run.c:1146:2: [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(s+n1, y->sval); data/9base-6/awk/run.c:1487:18: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. u = (Awkfloat) system(getsval(x)) / 256; /* 256 is unix-dep */ data/9base-6/awk/run.c:1644:8: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. fp = popen(s, "w"); data/9base-6/awk/run.c:1646:8: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. fp = popen(s, "r"); data/9base-6/awk/tran.c:370:4: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(s, *CONVFMT, vp->fval); data/9base-6/awk/tran.c:386:2: [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(p, s); data/9base-6/dc/dc.c:1925:4: [4] (shell) execl: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execl("/bin/rc","rc","-c",line,0); data/9base-6/diff/diffdir.c:32:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(cp[nitems], (db+n)->name); data/9base-6/echo/echo.c:25: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(p, argv[i]); data/9base-6/ed/ed.c:937:3: [4] (shell) execlp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execlp("rc", "rc", "-c", buf, (char*)0); data/9base-6/ed/ed.c:1604:8: [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. while(access(as, 0) != -1) { data/9base-6/fortune/fortune.c:66:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(choice, p); data/9base-6/fortune/fortune.c:87: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(choice, p); data/9base-6/hoc/symbol.c:26:2: [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(sp->name, s); data/9base-6/join/join.c:327:2: [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. fprintf(stderr, s1, s2); data/9base-6/lib9/_p9dir.c:135:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(*str, s); data/9base-6/lib9/_p9dir.c:159:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(*str, s); data/9base-6/lib9/_p9dir.c:182:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(*str, s); data/9base-6/lib9/_p9translate.c:40: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(new, replace[i].new); data/9base-6/lib9/_p9translate.c:41: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(new+nlen, old+olen); data/9base-6/lib9/announce.c:95:2: [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(sun.sun_path, unix); data/9base-6/lib9/await.c:108:4: [4] (buffer) strecpy: This function does not protect against buffer overflows (CWE-120). Ensure the destination has 4 times the size of the source, to leave room for expansion. strecpy(str, str+n, buf); data/9base-6/lib9/await.c:114:4: [4] (buffer) strecpy: This function does not protect against buffer overflows (CWE-120). Ensure the destination has 4 times the size of the source, to leave room for expansion. strecpy(str, str+n, buf); data/9base-6/lib9/date.c:45:4: [4] (buffer) strecpy: This function does not protect against buffer overflows (CWE-120). Ensure the destination has 4 times the size of the source, to leave room for expansion. strecpy(bigtm->zone, bigtm->zone+4, s); data/9base-6/lib9/dial.c:131:2: [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(su.sun_path, unix); data/9base-6/lib9/errstr.c:39:2: [4] (buffer) strecpy: This function does not protect against buffer overflows (CWE-120). Ensure the destination has 4 times the size of the source, to leave room for expansion. strecpy(tmp, tmp+ERRMAX, err); data/9base-6/lib9/errstr.c:42:2: [4] (buffer) strecpy: This function does not protect against buffer overflows (CWE-120). Ensure the destination has 4 times the size of the source, to leave room for expansion. strecpy(syserr, syserr+ERRMAX, tmp); data/9base-6/lib9/errstr.c:56: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(syserr, strerror(errno)); data/9base-6/lib9/errstr.c:57:2: [4] (buffer) strecpy: This function does not protect against buffer overflows (CWE-120). Ensure the destination has 4 times the size of the source, to leave room for expansion. strecpy(err, err+n, syserr); data/9base-6/lib9/exec.c:8:9: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. return execvp(prog, argv); data/9base-6/lib9/execl.c:5:1: [4] (shell) execl: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execl(char *prog, ...) data/9base-6/lib9/fmt/fltfmt.c:289: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(tmp, s); data/9base-6/lib9/fmt/fltfmt.c:297:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(s, tmp); data/9base-6/lib9/getuser.c:14:2: [4] (buffer) strecpy: This function does not protect against buffer overflows (CWE-120). Ensure the destination has 4 times the size of the source, to leave room for expansion. strecpy(user, user+sizeof user, pw->pw_name); data/9base-6/lib9/libc.h:47:14: [4] (buffer) strecpy: This function does not protect against buffer overflows (CWE-120). Ensure the destination has 4 times the size of the source, to leave room for expansion. extern char* strecpy(char*, char*, char*); data/9base-6/lib9/libc.h:393:14: [4] (tmpfile) mktemp: Temporary file race condition (CWE-377). extern char* mktemp(char*); data/9base-6/lib9/libc.h:443:9: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. #define syslog p9syslog data/9base-6/lib9/libc.h:804:9: [4] (shell) execl: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. #define execl p9execl data/9base-6/lib9/netmkaddr.c:22:6: [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(linear, 0) >= 0){ data/9base-6/lib9/post9p.c:38:4: [4] (shell) execlp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execlp("9pserve", "9pserve", "-u", addr, (char*)0); data/9base-6/lib9/post9p.c:71:4: [4] (shell) execlp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execlp("mount9p", "mount9p", "-", mtpt, (char*)0); data/9base-6/lib9/post9p.c:74:5: [4] (shell) execlp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execlp("9pfuse", "9pfuse", "-D", "-", mtpt, (char*)0); data/9base-6/lib9/post9p.c:76:5: [4] (shell) execlp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execlp("9pfuse", "9pfuse", "-", mtpt, (char*)0); data/9base-6/lib9/regex/regcomp.c:118:2: [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(buf, s); data/9base-6/lib9/regex/regerror.c:10:2: [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(buf, s); data/9base-6/lib9/searchpath.c:22:6: [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(name, AEXEC) >= 0) data/9base-6/lib9/searchpath.c:32: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(name, AEXEC) >= 0){ data/9base-6/lib9/searchpath.c:49:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(s, p); data/9base-6/lib9/searchpath.c:51:4: [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(s, name); data/9base-6/lib9/searchpath.c:52: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(s, AEXEC) >= 0){ data/9base-6/lib9/strecpy.c:4:1: [4] (buffer) strecpy: This function does not protect against buffer overflows (CWE-120). Ensure the destination has 4 times the size of the source, to leave room for expansion. strecpy(char *to, char *e, char *from) data/9base-6/lib9/syslog.c:37:1: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. syslog(int cons, char *logname, char *fmt, ...) data/9base-6/lib9/testfltfmt.c:119:2: [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(p, s); data/9base-6/lib9/testfltfmt.c:128:2: [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(p, s); data/9base-6/lib9/testfltfmt.c:139:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(ref, format, fmtvals[i]); data/9base-6/lib9/unsharp.c:38: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(new, replace[i].new); data/9base-6/lib9/unsharp.c:39: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(new+nlen, old+olen); data/9base-6/mk/env.c:126: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(w->s, cp+1); data/9base-6/mk/main.c:168:6: [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(MKFILE, 4) == 0) data/9base-6/mk/mk.c:179:38: [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(((node->flags&VIRTUAL) == 0) && (access(node->name, 0) == 0)){ data/9base-6/mk/recipe.c:57: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(buf, w->s); data/9base-6/mk/unix.c:165:4: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp(argv[0], argv); data/9base-6/mk/unix.c:233:3: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp(argv[0], argv); data/9base-6/mk/unix.c:296:2: [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(buf, temp); data/9base-6/mk/unix.c:307:5: [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(name, 0) >= 0) data/9base-6/mkdir/mkdir.c:19:5: [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(s, AEXIST) == 0){ data/9base-6/mkdir/mkdir.c:41:6: [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(s, AEXIST) != 0 && makedir(s) < 0) data/9base-6/mkdir/mkdir.c:45:5: [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(s, AEXIST) != 0) data/9base-6/rc/exec.c:562:2: [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(buf, lp->word); data/9base-6/rc/exec.c:563:2: [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(buf, rp->word); data/9base-6/rc/exec.c:676: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(s, a->word); data/9base-6/rc/exec.c:679:4: [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(s, p->word); data/9base-6/rc/glob.c:69:6: [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(globname, 0)==0) data/9base-6/rc/havefork.c:207: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, Fdprefix); data/9base-6/rc/haventfork.c:194:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(file, path->word); data/9base-6/rc/haventfork.c:200: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(file, argv[1]); data/9base-6/rc/plan9ish.c:218: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(p->status, w->msg); data/9base-6/rc/plan9ish.c:359:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(file, path->word); data/9base-6/rc/plan9ish.c:365: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(file, argv[1]); data/9base-6/rc/plan9ish.c:436:2: [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(p, dir[f].dbuf[dir[f].i].name); data/9base-6/rc/simple.c:170:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(dir, cdpath->word); data/9base-6/rc/simple.c:173:4: [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(dir, a->next->word); data/9base-6/rc/simple.c:357: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(file, path->word); data/9base-6/rc/simple.c:360: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(file, zero); data/9base-6/rc/simple.c:469:6: [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(file, path->word); data/9base-6/rc/simple.c:472:6: [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(file, a->word); data/9base-6/sam/_libc.h:18:14: [4] (shell) execv: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. #define exec execv data/9base-6/sam/disk.c:15:6: [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, AEXIST) == 0) data/9base-6/sam/io.c:189:3: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp(samterm, argv); data/9base-6/sam/io.c:204:3: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp(samterm, argv); data/9base-6/sam/io.c:256:3: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp(RXPATH, av); data/9base-6/sam/plan9.c:133:8: [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. while(access(tempnam, 0) == 0); data/9base-6/sam/shell.c:106:3: [4] (shell) execl: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execl(SHPATH, SH, "-c", Strtoc(&plan9cmd), (char *)0); data/9base-6/sam/unix.c:83: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, pw ? pw->pw_name : "nobody"); data/9base-6/split/split.c:120: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, stem); data/9base-6/split/split.c:121: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, suff); data/9base-6/split/split.c:135: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+len, suffix); data/9base-6/test/test.c:230: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. return access (a, f) >= 0; data/9base-6/troff/dwbinit.c:181: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(home, path); data/9base-6/troff/dwbinit.c:263:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(path, "%s/%s", prefix, value); data/9base-6/troff/dwbinit.c:266:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(path, "%s%s", prefix, value); data/9base-6/troff/dwbinit.c:268:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(path, "%s%s", prefix, value); data/9base-6/troff/dwbinit.c:270:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(path, "%s", prefix); data/9base-6/troff/dwbinit.c:277:6: [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(paths->value, path); data/9base-6/troff/dwbinit.c:309:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%s%s", home, path+len); data/9base-6/troff/dwbinit.c:310: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(path, buf); /* assuming there's room in path */ data/9base-6/troff/n1.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(termtab, &argv[0][2]); data/9base-6/troff/n1.c:92: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(fontdir, &argv[0][2]); data/9base-6/troff/n1.c:95: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(termtab, argv[0]); data/9base-6/troff/n1.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(fontdir, argv[0]); data/9base-6/troff/n1.c:117:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf + strlen(buf), ".nr %c %s\n", data/9base-6/troff/n1.c:127:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(mfiles[nmfi], nextf); data/9base-6/troff/n1.c:128:4: [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(mfiles[nmfi++], &argv[0][2]); data/9base-6/troff/n1.c:134:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(devname, &argv[0][2]); data/9base-6/troff/n1.c:247:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, ".ds .T %s\n", devname); data/9base-6/troff/n1.c:249:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, ".ds .P %s\n", DWBhomedir); data/9base-6/troff/n1.c:837: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(cfname[ifi],p); data/9base-6/troff/n1.c:907:2: [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(mfiles[nmfi], nextf); data/9base-6/troff/n1.c:944:2: [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(cfname[ifi+1], nextf); data/9base-6/troff/n1.c:968:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(cfname[ifi], nextf); data/9base-6/troff/n1.c:1074:2: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. system(sybuf); data/9base-6/troff/n10.c:31: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(buf+1, s); data/9base-6/troff/n10.c:95:3: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. sscanf(buf, "%s %s %[^\n]", ch, s1, s2); data/9base-6/troff/n10.c:166: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(devname, p); data/9base-6/troff/n10.c:168: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(termtab,DWBntermdir); data/9base-6/troff/n10.c:172: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(devname, NDEVNAME); data/9base-6/troff/n10.c:188:2: [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(termtab, devname); data/9base-6/troff/n10.c:199:2: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. fscanf(fp, "%s", cmd); /* should be device name... */ data/9base-6/troff/n10.c:203:3: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. fscanf(fp, "%s", cmd); data/9base-6/troff/n2.c:15:7: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. FILE* popen(char*, char*); data/9base-6/troff/n2.c:193:32: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (!Pipe.buf[0] || (ptid = popen(Pipe.buf, "w")) == NULL) data/9base-6/troff/n2.c:323:2: [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(Pipe.buf, buf); data/9base-6/troff/n4.c:555:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(err_buf, "%c%s: %s", nb ? cbits(c2) : cbits(cc), data/9base-6/troff/n4.c:558:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(err_buf, "\\%c'%s': %s", numerr.esc, &numerr.escarg, data/9base-6/troff/n5.c:470: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(&tmbuf[i], p+1); data/9base-6/troff/n5.c:473:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(&tmbuf[i], "\\N'%s'", p+1); data/9base-6/troff/n5.c:477:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(&tmbuf[i], "\\(%s", p+1); data/9base-6/troff/n5.c:479:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(&tmbuf[i], "\\C'%s'", p+1); data/9base-6/troff/n5.c:482:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(&tmbuf[i]," %s? ", p); data/9base-6/troff/n8.c:477:3: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. sscanf(buf, "%s", buf1); data/9base-6/troff/n8.c:514:2: [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(nextpat, num); data/9base-6/troff/t10.c:51: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(devname, p); data/9base-6/troff/t10.c:53: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(termtab, DWBfontdir); data/9base-6/troff/t10.c:55: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(fontdir, DWBfontdir); data/9base-6/troff/t10.c:57: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(devname, TDEVNAME); data/9base-6/troff/t10.c:61:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "/dev%s/DESC", devname); data/9base-6/troff/t10.c:62:2: [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(termtab, buf); data/9base-6/troff/t11.c:29:9: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. while (fscanf(fin, "%s", cmd) != EOF) { data/9base-6/troff/t11.c:45:5: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. fscanf(fin, "%s", s); data/9base-6/troff/t11.c:49:11: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. while (fscanf(fin, "%s", s) != EOF) data/9base-6/troff/t11.c:73:3: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. sscanf(buf, "%s", buf2); data/9base-6/troff/t11.c:109:9: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. while (fscanf(fin, "%s", cmd) != EOF) { data/9base-6/troff/t11.c:111:4: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. fscanf(fin, "%s", ftemp->longname); data/9base-6/troff/t11.c:125:5: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. sscanf(buf, "%s %s %s %s", ch, s1, s2, s3); data/9base-6/troff/t11.c:224:2: [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(chnames[nchnames]+1, s); data/9base-6/troff/t11.c:245:9: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. while (fscanf(fin, "%s", temp) != EOF && strcmp(temp, "0") != 0) { data/9base-6/troff/t6.c:707:2: [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(t, s); data/9base-6/troff/t6.c:719: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(shortname, truename); data/9base-6/troff/t6.c:721: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(shortname, (char *) unpair(f)); data/9base-6/troff/t6.c:723:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(pathname, "%s", truename); data/9base-6/troff/t6.c:728:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(pathname, "%s/dev%s/%s", fontdir, devname, truename); data/9base-6/troff/t6.c:731:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(pathname, "%s/dev%s/%s", fontdir, devname, shortname); data/9base-6/troff/tdef.h:61:31: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. #define OUT (obufp += strlen(sprintf(obufp, data/9base-6/troff/tdef.h:64:24: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. #define OUT (obufp += sprintf(obufp, data/9base-6/troff/tdef.h:72:15: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. #define ERROR sprintf(errbuf, data/9base-6/yacc/yacc.c:2180: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(buf, ytabc); data/9base-6/awk/run.c:1498:3: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand((unsigned int) u); data/9base-6/fmt/fmt.c:60:4: [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. s=getenv("tabstop"); data/9base-6/fortune/fortune.c:59:3: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(getpid()); data/9base-6/fortune/fortune.c:71:3: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(getpid()); data/9base-6/getflags/getflags.c:49:10: [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. flags = getenv("flagfmt"); data/9base-6/lib9/_p9translate.c:23:20: [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. replace[0].new = getenv("PLAN9"); data/9base-6/lib9/date.c:43:7: [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. s = getenv("TIMEZONE"); data/9base-6/lib9/date.c:102:7: [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. tz = getenv("TZ"); data/9base-6/lib9/get9root.c:12:10: [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((s = getenv("PLAN9")) != 0) data/9base-6/lib9/getenv.c:10:6: [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. t = getenv(s); data/9base-6/lib9/getns.c:31:13: [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((disp = getenv("DISPLAY")) == nil){ data/9base-6/lib9/getns.c:89:7: [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. ns = getenv("NAMESPACE"); data/9base-6/lib9/getwd.c:4:8: [3] (buffer) getwd: This does not protect against buffer overflows by itself, so use with caution (CWE-120, CWE-20). Use getcwd instead. #undef getwd data/9base-6/lib9/libc.h:255:9: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. #define srand p9srand data/9base-6/lib9/libc.h:431:9: [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 getenv p9getenv data/9base-6/lib9/libc.h:432:9: [3] (buffer) getwd: This does not protect against buffer overflows by itself, so use with caution (CWE-120, CWE-20). Use getcwd instead. #define getwd p9getwd data/9base-6/lib9/searchpath.c:27:9: [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. path = getenv("PATH"); data/9base-6/lib9/sysname.c:13:10: [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((q = getenv("sysname")) != nil && q[0] != 0){ data/9base-6/lib9/zoneinfo.c:123: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 ((tmp=getenv("timezone"))!=nil) { data/9base-6/pbd/pbd.c:10:5: [3] (buffer) getwd: This does not protect against buffer overflows by itself, so use with caution (CWE-120, CWE-20). Use getcwd instead. if(getwd(buf, sizeof buf)){ data/9base-6/sam/_libc.h:20:9: [3] (buffer) getwd: This does not protect against buffer overflows by itself, so use with caution (CWE-120, CWE-20). Use getcwd instead. #define getwd getcwd data/9base-6/sam/mesg.c:529:4: [3] (buffer) getwd: This does not protect against buffer overflows by itself, so use with caution (CWE-120, CWE-20). Use getcwd instead. getwd(wdir, 1024); data/9base-6/sam/plan9.c:128:14: [3] (tmpfile) tempnam: Temporary file race condition (CWE-377). static char tempnam[30]; data/9base-6/sam/plan9.c:132:11: [3] (tmpfile) tempnam: Temporary file race condition (CWE-377). snprint(tempnam, sizeof tempnam, "%s/%d%.4s%dsam", TMPDIR, num, getuser(), i++); data/9base-6/sam/plan9.c:132:27: [3] (tmpfile) tempnam: Temporary file race condition (CWE-377). snprint(tempnam, sizeof tempnam, "%s/%d%.4s%dsam", TMPDIR, num, getuser(), i++); data/9base-6/sam/plan9.c:133:15: [3] (tmpfile) tempnam: Temporary file race condition (CWE-377). while(access(tempnam, 0) == 0); data/9base-6/sam/plan9.c:134:14: [3] (tmpfile) tempnam: Temporary file race condition (CWE-377). fd = create(tempnam, ORDWR|OCEXEC|ORCLOSE, 0000); data/9base-6/sam/plan9.c:136:10: [3] (tmpfile) tempnam: Temporary file race condition (CWE-377). remove(tempnam); data/9base-6/sam/plan9.c:137:15: [3] (tmpfile) tempnam: Temporary file race condition (CWE-377). fd = create(tempnam, ORDWR|OCEXEC|ORCLOSE, 0000); data/9base-6/sam/sam.c:89:9: [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. home = getenv(HOME); data/9base-6/sam/sam.c:155:10: [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. root = getenv("PLAN9"); data/9base-6/sam/sam.c:502:2: [3] (buffer) getwd: This does not protect against buffer overflows by itself, so use with caution (CWE-120, CWE-20). Use getcwd instead. getwd(buf, sizeof(buf)); data/9base-6/sam/unix.c:156:15: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. tmp = getenv("TMPDIR"); data/9base-6/troff/dwbinit.c:120:36: [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 ( debug == NULL && (debug = getenv(DWBDEBUG)) == NULL ) data/9base-6/troff/dwbinit.c:188:15: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if ( (home = getenv(DWBENV)) == NULL ) { data/9base-6/troff/n10.c:165:11: [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 ((p = getenv("NROFFTERM")) != 0) data/9base-6/troff/t10.c:50:11: [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 ((p = getenv("TYPESETTER")) != 0) data/9base-6/yacc/yacc.c:1241:25: [3] (buffer) getwd: This does not protect against buffer overflows by itself, so use with caution (CWE-120, CWE-20). Use getcwd instead. if(infile[0] != '/' && getwd(dirbuf, sizeof dirbuf)!=nil){ data/9base-6/ascii/ascii.c:16: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 *str[256]={ data/9base-6/awk/lex.c:393: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. { char xbuf[100], *px; data/9base-6/awk/lex.c:525: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 ebuf[300]; data/9base-6/awk/lex.c:527: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 yysbuf[100]; /* pushback buffer */ data/9base-6/awk/lib.c:43: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 inputFS[100] = " "; data/9base-6/awk/lib.c:74: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 temp[50]; data/9base-6/awk/lib.c:82: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(temp, "%d", i); data/9base-6/awk/lib.c:138:23: [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). else if ((infile = fopen(file, "r")) == NULL) data/9base-6/awk/lib.c:223: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 *s, temp[50]; data/9base-6/awk/lib.c:226:2: [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(temp, "%d", n); data/9base-6/awk/lib.c:297: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 buf[2]; data/9base-6/awk/main.c:47: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 *pfile[20]; /* program filenames from -f's */ data/9base-6/awk/main.c:108: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). temp = atoi(&argv[1][3]); data/9base-6/awk/main.c:111: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). temp = atoi(&argv[1][0]); data/9base-6/awk/main.c:120:10: [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). dbg = atoi(&argv[1][2]); data/9base-6/awk/main.c:178:21: [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). else if ((yyin = fopen(pfile[curpfile], "r")) == NULL) data/9base-6/awk/maketab.c:110: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 *table[SIZE]; data/9base-6/awk/maketab.c:111: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 *names[SIZE]; data/9base-6/awk/maketab.c:119: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[200], name[200], def[200]; data/9base-6/awk/maketab.c:127:12: [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). if ((fp = fopen("y.tab.h", "r")) == NULL) { data/9base-6/awk/proctab.c:6: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 *printname[92] = { data/9base-6/awk/proctab.c:199: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 buf[100]; data/9base-6/awk/proctab.c:202: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(buf, "token %d", n); data/9base-6/awk/re.c:59: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 re[MAXRE]; /* copy buffer */ data/9base-6/awk/run.c:822:11: [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). fmtwd = atoi(s+1); data/9base-6/awk/run.c:834: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(t-1, "%d", fmtwd=(int) getfval(x)); data/9base-6/awk/run.c:1199: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 *t, temp, num[50], *fs = 0; data/9base-6/awk/run.c:1234: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(num, "%d", n); data/9base-6/awk/run.c:1245:6: [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(num, "%d", n); data/9base-6/awk/run.c:1252: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(num, "%d", n); data/9base-6/awk/run.c:1272:4: [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(num, "%d", n); data/9base-6/awk/run.c:1283: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 buf[2]; data/9base-6/awk/run.c:1285:4: [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(num, "%d", n); data/9base-6/awk/run.c:1301:4: [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(num, "%d", n); data/9base-6/awk/run.c:1451: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 mbc[50]; data/9base-6/awk/run.c:1639: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(s, "w"); data/9base-6/awk/run.c:1641: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(s, "a"); data/9base-6/awk/run.c:1648:38: [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 = strcmp(s, "-") == 0 ? stdin : fopen(s, "r"); /* "-" is stdin */ data/9base-6/awk/tran.c:102: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 temp[50]; data/9base-6/awk/tran.c:109: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(temp, "%d", i); data/9base-6/awk/tran.c:282:11: [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). fldno = atoi(vp->nval); data/9base-6/awk/tran.c:318:11: [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). fldno = atoi(vp->nval); data/9base-6/awk/tran.c:355: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 s[100]; /* BUG: unchecked */ data/9base-6/awk/tran.c:368:4: [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(s, "%.30g", vp->fval); data/9base-6/cal/cal.c:22: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 string[432]; data/9base-6/cat/cat.c:7: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[8192]; data/9base-6/cat/cat.c:26:7: [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(argv[i], OREAD); data/9base-6/cmp/cmp.c:31:11: [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((f1 = open(name1 = *argv++, OREAD)) == -1){ data/9base-6/cmp/cmp.c:35:11: [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((f2 = open(name2 = *argv++, OREAD)) == -1){ data/9base-6/dc/dc.c:1908: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 line[100], *sl; data/9base-6/dd/dd.c:175: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). ibf = open(ifile, 0); data/9base-6/dd/dd.c:186:10: [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). obf = open(ofile, 1); data/9base-6/diff/diffdir.c:22: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(name, OREAD)) < 0){ data/9base-6/diff/diffdir.c:62: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 fb[MAXPATHLEN+1], tb[MAXPATHLEN+1]; data/9base-6/diff/diffio.c:121: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 *cp, buf[MAXLINELEN]; data/9base-6/diff/diffio.c:191: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 fbuf[MAXLINELEN], tbuf[MAXLINELEN]; data/9base-6/diff/diffio.c:228: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[MAXLINELEN]; data/9base-6/diff/diffio.c:264: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[4]; data/9base-6/diff/main.c:81: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[8192]; data/9base-6/diff/main.c:88:7: [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). fd = mkstemp(p=tmp[whichtmp++]); data/9base-6/diff/main.c:123:16: [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 ((input = open(file, OREAD)) == -1) { data/9base-6/diff/main.c:138: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 *fp, *tp, *p, fb[MAXPATHLEN+1], tb[MAXPATHLEN+1]; data/9base-6/du/du.c:74: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 file[256]; data/9base-6/du/du.c:80:7: [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). fd = open(name, OREAD); data/9base-6/ed/ed.c:34:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char file[FNSIZE]; data/9base-6/ed/ed.c:43: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 line[70]; data/9base-6/ed/ed.c:59: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 savedfile[FNSIZE]; data/9base-6/ed/ed.c:321:11: [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((io=open(file, OREAD)) < 0) { data/9base-6/ed/ed.c:374:13: [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). ((io = open(file, OWRITE)) == -1) || data/9base-6/ed/ed.c:710: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 s[UTFmax]; data/9base-6/ed/ed.c:924: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[512]; data/9base-6/ed/ed.c:1433: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 expbuf[ESIZE]; data/9base-6/fmt/fmt.c:22: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 text[1]; data/9base-6/fmt/fmt.c:42:17: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). extraindent = atoi(EARGF(usage())); data/9base-6/fmt/fmt.c:49: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). length = atoi(EARGF(usage())); data/9base-6/fmt/fmt.c:61:15: [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). if(s!=nil && atoi(s)>0) data/9base-6/fmt/fmt.c:62:10: [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). maxtab=atoi(s); data/9base-6/fmt/fmt.c:70: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). f = open(argv[i], OREAD); data/9base-6/fortune/fortune.c:6: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 choice[2048]; data/9base-6/fortune/fortune.c:34: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). ix = open(index, OREAD); data/9base-6/fortune/fortune.c:68:4: [2] (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). Risk is low because the source is a constant string. strcpy(choice, "Misfortune!"); data/9base-6/freq/freq.c:53:7: [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(argv[i], 0); data/9base-6/getflags/getflags.c:42: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 *flags, *p, buf[512]; data/9base-6/grep/comp.c:142: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 xc0[6], xc1[6]; data/9base-6/grep/grep.h:72: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 string[16*1024]; data/9base-6/grep/grep.h:89: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. EXTERN char flags[256]; data/9base-6/grep/main.c:93: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). fid = open(file, OREAD); data/9base-6/join/join.c:80:18: [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). olist[no] = atoi(&argv[2][2]); data/9base-6/join/join.c:82:18: [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). olist[no] = atoi(&argv[2][2]); data/9base-6/join/join.c:96:10: [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). j1 = atoi(argv[2]); data/9base-6/join/join.c:98:10: [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). j2 = atoi(argv[2]); data/9base-6/join/join.c:100:15: [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). j1 = j2 = atoi(argv[2]); data/9base-6/join/join.c:105:9: [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). j1 = atoi(getoptarg(&argc, &argv)); data/9base-6/join/join.c:108:9: [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). j2 = atoi(getoptarg(&argc, &argv)); data/9base-6/join/join.c:126:20: [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). else if ((f[F1] = fopen(argv[1], "r")) == 0) data/9base-6/join/join.c:130:22: [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). } else if ((f[F2] = fopen(argv[2], "r")) == 0) data/9base-6/join/join.c:260: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 line[BUFSIZ]; data/9base-6/join/join.c:290: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[BUFSIZ]; data/9base-6/join/join.c:360:17: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). olist[no] = atoi(s += 2); data/9base-6/lib9/_p9dir.c:109: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[20]; data/9base-6/lib9/_p9dir.c:226:13: [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(name, O_RDONLY)) >= 0){ data/9base-6/lib9/atoi.c:5:1: [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). atoi(char *s) data/9base-6/lib9/atol.c:5:1: [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). atol(char *s) data/9base-6/lib9/await.c:89: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[128], tmp[64]; data/9base-6/lib9/bio.h:45: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 b[Bungetsize+Bsize]; data/9base-6/lib9/bio/bcat.c: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 buf[1000]; data/9base-6/lib9/bio/bgetrune.c: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 str[4]; data/9base-6/lib9/bio/binit.c:125:7: [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(name, mode); data/9base-6/lib9/bio/bputrune.c: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 str[4]; data/9base-6/lib9/convD2M.c: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 *sv[5]; data/9base-6/lib9/convD2M.c:42: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 *sv[5]; data/9base-6/lib9/convM2D.c:48: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 *sv[5]; data/9base-6/lib9/create.c:34: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). fd = open(path, O_RDONLY); data/9base-6/lib9/create.c:54: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). fd = open(path, umode, perm); data/9base-6/lib9/ctime.c:38: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 dmsize[12] = data/9base-6/lib9/ctime.c:126:2: [2] (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). Risk is low because the source is a constant string. strcpy(xtime.zone, "GMT"); data/9base-6/lib9/ctime.c:134: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 cbuf[30]; data/9base-6/lib9/ctime.c:136:2: [2] (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). Risk is low because the source is a constant string. strcpy(cbuf, "Thu Jan 01 00:00:00 GMT 1970\n"); data/9base-6/lib9/dial.c:122:10: [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((s = open(unix, ORDWR)) >= 0) data/9base-6/lib9/dirfstat.c:15: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 *str, tmp[100]; data/9base-6/lib9/dirmodefmt.c:25: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 buf[16]; data/9base-6/lib9/dirread.c:79: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((oldwd = open(".", O_RDONLY)) < 0) data/9base-6/lib9/encodefmt.c:12: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 obuf[64]; /* rsc optimization */ data/9base-6/lib9/errstr.c:19: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 xsyserr[ERRMAX]; data/9base-6/lib9/errstr.c:36: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[ERRMAX]; data/9base-6/lib9/errstr.c:54:3: [2] (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). Risk is low because the source is a constant string. strcpy(syserr, "interrupted"); data/9base-6/lib9/errstr.c:74: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[ERRMAX]; data/9base-6/lib9/fcall.h:35: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 *wname[MAXWELEM]; /* Twalk */ data/9base-6/lib9/fcallfmt.c:16: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[512], tmp[200]; data/9base-6/lib9/fcallfmt.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 buf[160]; data/9base-6/lib9/fcallfmt.c:186: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[16]; data/9base-6/lib9/fmt/dofmt.c:227: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 x[1]; data/9base-6/lib9/fmt/dofmt.c:329: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[140], *p, *conv; data/9base-6/lib9/fmt/dofmt.c:608: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 x[3]; data/9base-6/lib9/fmt/fltfmt.c:154: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 se[9]; data/9base-6/lib9/fmt/fltfmt.c:185: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[NSIGNIF+10]; data/9base-6/lib9/fmt/fltfmt.c:340: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[NSIGNIF+10], *dot, *digits, *p, *s, suf[10], *t; data/9base-6/lib9/fmt/strtod.c:81: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 *s, a[Ndig]; data/9base-6/lib9/fmt/test3.c: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 fmtbuf[100], stdbuf[100]; data/9base-6/lib9/fmt/vfprint.c:11: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[256]; data/9base-6/lib9/getuser.c:8: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 user[64]; data/9base-6/lib9/libc.h:322: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 zone[4]; data/9base-6/lib9/libc.h:426:9: [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). #define atoi p9atoi data/9base-6/lib9/libc.h:427:9: [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). #define atol p9atol data/9base-6/lib9/libc.h:813: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). #undef open data/9base-6/lib9/libc.h:814: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). #define open p9open data/9base-6/lib9/netmkaddr.c:11: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 addr[256]; data/9base-6/lib9/notify.c:121: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[64]; data/9base-6/lib9/open.c:43:7: [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). fd = open(name, umode); data/9base-6/lib9/opentemp.c:9:7: [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). fd = mkstemp(template); data/9base-6/lib9/opentemp.c:12: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((fd1 = open(template, mode)) < 0){ data/9base-6/lib9/readcons.c:30: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 line[10]; data/9base-6/lib9/readcons.c:34:11: [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("/dev/tty", ORDWR)) < 0) data/9base-6/lib9/regex/regcomp.c: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 buf[100]; data/9base-6/lib9/regex/regcomp.c:116: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[100]; data/9base-6/lib9/regex/regcomp.c:117:2: [2] (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). Risk is low because the source is a constant string. strcpy(buf, "can't happen: "); data/9base-6/lib9/regex/regerror.c:7: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[132]; data/9base-6/lib9/regex/regerror.c:9:2: [2] (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). Risk is low because the source is a constant string. strcpy(buf, "regerror: "); data/9base-6/lib9/regex/test.c:28: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 dst[128]; data/9base-6/lib9/rfork.c:19: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[128], *q; data/9base-6/lib9/sec/libsec.h:247:32: [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. uchar* X509gen(RSApriv *priv, char *subj, ulong valid[2], int *certlen); data/9base-6/lib9/sec/libsec.h:342: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 dir[40]; /* connection directory */ data/9base-6/lib9/sendfd.c:28: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[1]; data/9base-6/lib9/sendfd.c:33: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 cms[CMSG_SPACE(sizeof(int))]; data/9base-6/lib9/sendfd.c:61: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[1]; data/9base-6/lib9/sendfd.c:65: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 cms[CMSG_SPACE(sizeof(int))]; data/9base-6/lib9/sysfatal.c: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 buf[256]; data/9base-6/lib9/syslog.c:20: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[1024], *p; data/9base-6/lib9/syslog.c:26:10: [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). sl.fd = open(p, OWRITE|OCEXEC|OAPPEND); data/9base-6/lib9/syslog.c:39: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[1024]; data/9base-6/lib9/syslog.c:44: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 err[ERRMAX]; data/9base-6/lib9/syslog.c:85:16: [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). sl.consfd = open("/dev/tty", OWRITE|OCEXEC); data/9base-6/lib9/sysname.c:7: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 buf[512]; data/9base-6/lib9/sysname.c:28:2: [2] (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). Risk is low because the source is a constant string. strcpy(buf, "gnot"); data/9base-6/lib9/testfltfmt.c:96: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 format[256]; data/9base-6/lib9/testfltfmt.c:135: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 ref[1024], buf[1024]; data/9base-6/lib9/testprint.c:13:18: [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). print(argv[1], atoi(argv[2])); data/9base-6/lib9/truerand.c:13: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). randfd = open(randfile="/dev/random", OREAD); data/9base-6/lib9/truerand.c:16:13: [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). randfd = open(randfile="/dev/srandom", OREAD); /* OpenBSD */ data/9base-6/lib9/utf/rune.c:138: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 str[10]; data/9base-6/lib9/wait.c: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 *fld[5]; data/9base-6/lib9/wait.c:22:11: [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). w->pid = atoi(fld[0]); data/9base-6/lib9/wait.c:23:15: [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). w->time[0] = atoi(fld[1]); data/9base-6/lib9/wait.c:24:15: [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). w->time[1] = atoi(fld[2]); data/9base-6/lib9/wait.c:25:15: [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). w->time[2] = atoi(fld[3]); data/9base-6/lib9/wait.c:34: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[256]; data/9base-6/lib9/wait.c:42: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[256]; data/9base-6/lib9/wait.c:50: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[256]; data/9base-6/lib9/waitpid.c: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 buf[512], *fld[5]; data/9base-6/lib9/waitpid.c:18:9: [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). return atoi(fld[0]); data/9base-6/lib9/zoneinfo.c:36:7: [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). fd = open(file, OREAD); data/9base-6/ls/ls.c:109: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). fd = open(s, OREAD); data/9base-6/ls/ls.c:143: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[4096]; data/9base-6/ls/ls.c:166: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[256]; data/9base-6/ls/ls.c:295: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 buf[32]; data/9base-6/mk/arc.c:22: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[1024]; data/9base-6/mk/arc.c:46: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). nreps = atoi(w->s); data/9base-6/mk/archive.c: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 name[SARNAME]; data/9base-6/mk/archive.c:11: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 date[12]; data/9base-6/mk/archive.c:12: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 uid[6]; data/9base-6/mk/archive.c:13: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 gid[6]; data/9base-6/mk/archive.c:14: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 mode[8]; data/9base-6/mk/archive.c:15: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 size[10]; data/9base-6/mk/archive.c:16: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 fmag[2]; data/9base-6/mk/archive.c:49: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 *archive, *member, buf[512]; data/9base-6/mk/archive.c:91:7: [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). fd = open(archive, ORDWR); data/9base-6/mk/archive.c:113:8: [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). t = atol(h.size); data/9base-6/mk/archive.c:127: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[2048], *p, *strings; data/9base-6/mk/archive.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 name[1024]; data/9base-6/mk/archive.c:132:7: [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). fd = open(ar, OREAD); data/9base-6/mk/archive.c:141:7: [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). t = atol(h.date); data/9base-6/mk/archive.c:146:14: [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). namelen = atoi(h.name+3); data/9base-6/mk/archive.c:159:8: [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). t = atol(h.size); data/9base-6/mk/archive.c:201:7: [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). t = atol(h.size); data/9base-6/mk/archive.c:214: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[SARMAG]; data/9base-6/mk/archive.c:216:7: [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). fd = open(file, OREAD); data/9base-6/mk/bufblock.c:43: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(f->start, p->start, p->end-p->start); data/9base-6/mk/env.c: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 buf[256]; data/9base-6/mk/graph.c:37: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 stem[NAMEBLOCK], buf[NAMEBLOCK]; data/9base-6/mk/graph.c:180: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[1024]; data/9base-6/mk/main.c:29: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 *files[256], **f = files, **ff; data/9base-6/mk/main.c:169:18: [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). parse(MKFILE, open(MKFILE, 0), 0); data/9base-6/mk/main.c:172: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). parse(*ff, open(*ff, 0), 0); data/9base-6/mk/mk.c:66: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 buf[1024]; data/9base-6/mk/mk.c:197: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[3*NAMEBLOCK]; data/9base-6/mk/mk.c:211: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[3*NAMEBLOCK], *str; data/9base-6/mk/mk.h:81: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 *match[NREGEXP]; data/9base-6/mk/parse.c:43: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). newfd = open(p, OREAD); data/9base-6/mk/recipe.c:6: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[BIGBLOCK]; data/9base-6/mk/run.c:102: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[ERRMAX]; data/9base-6/mk/run.c:187:17: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). nproclimit = atoi(w->s); data/9base-6/mk/shprint.c:109: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 *flds[512]; data/9base-6/mk/sys.std.h:22:34: [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). #define create(name, mode, perm) open(name, mode|O_CREAT, perm) data/9base-6/mk/unix.c:58: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 buf[16384]; data/9base-6/mk/unix.c:293: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 buf[100]; data/9base-6/mk/unix.c:297:7: [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). fd = mkstemp(buf); data/9base-6/pbd/pbd.c:7: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[512], *p; data/9base-6/rc/code.c:25:29: [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. codebuf = (code *)realloc((char *)codebuf, ncode*sizeof codebuf[0]); data/9base-6/rc/exec.c:136: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 num[12], *rcmain; data/9base-6/rc/exec.c:256:10: [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((f = open(file, 1))<0 && (f = Creat(file))<0){ data/9base-6/rc/exec.c:373:10: [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((f = open(file, 0))<0){ data/9base-6/rc/exec.c:400:10: [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((f = open(file, ORDWR))<0){ data/9base-6/rc/exec.c:761: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 num[12]; data/9base-6/rc/exec.c:860: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 v[NSTATUS+1]; data/9base-6/rc/exec.c:874: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 status[NSTATUS+1]; data/9base-6/rc/exec.h:55: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 status[NSTATUS]; /* status for Xpipewait */ data/9base-6/rc/getflags.c:7: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 **flag[NFLAG]; data/9base-6/rc/getflags.c:8: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 cmdline[NCMDLINE+1]; data/9base-6/rc/getflags.c:234: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 buf[NBUF], *bufp = buf; data/9base-6/rc/getflags.h:3: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. extern char **flag[NFLAG]; data/9base-6/rc/getflags.h:4: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. extern char cmdline[NCMDLINE+1]; data/9base-6/rc/havefork.c:18:13: [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 null = open("/dev/null", 0); data/9base-6/rc/havefork.c:21: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 npid[10]; data/9base-6/rc/havefork.c:47:13: [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((tty = open("/dev/tty", OREAD)) >= 0){ data/9base-6/rc/havefork.c:113: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 wd[8193]; data/9base-6/rc/havefork.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 name[40]; data/9base-6/rc/havefork.c:241: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[ERRMAX]; data/9base-6/rc/havefork.c:250:3: [2] (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). Risk is low because the source is a constant string. strcpy(buf, "can't exec: "); data/9base-6/rc/haventfork.c:36: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[20], **argv; data/9base-6/rc/haventfork.c:57: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 wd[8193], **argv; data/9base-6/rc/haventfork.c:182: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 file[1024]; data/9base-6/rc/here.c:52: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 line[NLINE+1]; data/9base-6/rc/io.c:11: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 err[ERRMAX]; data/9base-6/rc/io.h:11: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 *bufp, *ebuf, *strp, buf[NBUF]; data/9base-6/rc/lex.c:199:4: [2] (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). Risk is low because the source is a constant string. strcpy(tok, "( [SUB]"); data/9base-6/rc/lex.c:212:3: [2] (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). Risk is low because the source is a constant string. strcpy(tok, "EOF"); data/9base-6/rc/lex.c:217:4: [2] (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). Risk is low because the source is a constant string. strcpy(tok, "$#"); data/9base-6/rc/lex.c:221:4: [2] (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). Risk is low because the source is a constant string. strcpy(tok, "$\""); data/9base-6/rc/lex.c:230:4: [2] (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). Risk is low because the source is a constant string. strcpy(tok, "&&"); data/9base-6/rc/lex.c:239:4: [2] (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). Risk is low because the source is a constant string. strcpy(tok, "||"); data/9base-6/rc/plan9ish.c:200: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 errbuf[ERRMAX]; data/9base-6/rc/plan9ish.c:345: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. qsort((char *)env, nvar, sizeof ep[0], cmpenv); data/9base-6/rc/plan9ish.c:353: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 file[1024]; data/9base-6/rc/plan9ish.c:401:4: [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(name, 0); data/9base-6/rc/plan9ish.c:560:6: [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). n = atoi(msg); data/9base-6/rc/rc.h:76: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 tok[NTOK]; data/9base-6/rc/simple.c:147:13: [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). wdirfd = open("/dev/wdir", OWRITE|OCEXEC); data/9base-6/rc/simple.c:159: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 dir[512]; data/9base-6/rc/simple.c:225:7: [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). n = atoi(runq->argv->words->next->word); data/9base-6/rc/simple.c:323: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 file[512]; data/9base-6/rc/simple.c:361: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(file, 0))>=0) break; data/9base-6/rc/simple.c:427: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 file[512]; data/9base-6/rc/simple.c:497:11: [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). Waitfor(atoi(runq->argv->words->next->word), 0); data/9base-6/read/read.c:68:13: [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). nlines = atoi(s); data/9base-6/read/read.c:81: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). fd = open(argv[i], OREAD); data/9base-6/sam/address.c:146: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 *c, buf[STRSIZE+100]; data/9base-6/sam/cmd.c:74: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[UTFmax]; data/9base-6/sam/disk.c: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 buf[128]; data/9base-6/sam/error.c:72: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[512]; data/9base-6/sam/error.c:81: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[512]; data/9base-6/sam/error.c:90: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[512]; data/9base-6/sam/error.c:99: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[512]; data/9base-6/sam/io.c:85: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[BLOCKSIZE+1], *s; data/9base-6/sam/mesg.c:98: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[32]; data/9base-6/sam/mesg.c:107: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[32]; data/9base-6/sam/mesg.c:192: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 cbuf[64]; data/9base-6/sam/plan9.c:31: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[BLOCKSIZE]; data/9base-6/sam/plan9.c:55: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 user[64]; data/9base-6/sam/plan9.c:59: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). fd = open("/dev/user", 0); data/9base-6/sam/plan9.c:61:4: [2] (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). Risk is low because the source is a constant string. strcpy(user, "none"); data/9base-6/sam/plan9.c:128: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 tempnam[30]; data/9base-6/sam/regexp.c:241: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[100]; data/9base-6/sam/sam.c:46: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 *termargs[10], **ap; data/9base-6/sam/sam.c:132: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[256]; data/9base-6/sam/sam.c:233: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[256]; data/9base-6/sam/sam.c:246:4: [2] (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). Risk is low because the source is a constant string. strcpy(buf, "nameless file"); data/9base-6/sam/sam.c:353:11: [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((io = open(genc, OREAD))<0) { data/9base-6/sam/sam.c:499: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[256]; data/9base-6/sam/sam.c:527:7: [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). fd = open("/dev/wdir", OWRITE); data/9base-6/sam/shell.c:6: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 errfile[64]; data/9base-6/sam/shell.c:14: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[1024]; data/9base-6/sam/shell.c:57:10: [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). fd = open("/dev/null", 0); data/9base-6/sam/shell.c:104:4: [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("/dev/null", 0); data/9base-6/sam/shell.c:145: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[BLOCKSIZE-10]; data/9base-6/sam/shell.c:151: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). if((f=open(errfile, 0)) != -1){ data/9base-6/sam/sys.c:18: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[ERRMAX]; data/9base-6/sam/sys.c:31: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[ERRMAX]; data/9base-6/sam/unix.c:56: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[BLOCKSIZE]; data/9base-6/sam/unix.c:80: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 user[64]; data/9base-6/sam/unix.c:163: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 ((fd = mkstemp(buf)) < 0) /* SES - linux sometimes uses mode 0666 */ data/9base-6/sam/unix.c:173: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 buf[4096]; data/9base-6/sam/unix.c:190:6: [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). r = atoi(w->msg); data/9base-6/sed/sed.c:149: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 fname[MAXFILES][40]; /* File name cache */ data/9base-6/sed/sed.c:601: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(name, OWRITE)) < 0 && data/9base-6/sed/sed.c:647: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 expbuf[512]; data/9base-6/sed/sed.c:1341: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[128]; data/9base-6/seq/seq.c:24: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 fmt[16]; data/9base-6/seq/seq.c:25: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[32]; data/9base-6/seq/seq.c:53: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[256], ffmt[4096]; data/9base-6/sha1sum/sha1sum.c: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 buf[SHA1dlen*2+1]; data/9base-6/sha1sum/sha1sum.c:52: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). fd = open(argv[i], OREAD); data/9base-6/sleep/sleep.c:10:14: [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). for(secs = atol(argv[1]); secs > 0; secs--) data/9base-6/sort/sort.c:151:7: [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(s, OREAD); data/9base-6/sort/sort.c:354: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 file[100]; data/9base-6/sort/sort.c:426:7: [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(tf, OREAD); data/9base-6/sort/sort.c:800:20: [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). args.mline = atol(argv[i]); data/9base-6/sort/sort.c:804:19: [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). args.mline = atol(s); data/9base-6/split/split.c:11: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 name[200]; data/9base-6/split/split.c:33: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[256]; data/9base-6/split/split.c:38:5: [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). n=atoi(EARGF(usage())); data/9base-6/tail/tail.c:93:23: [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(argc > 1 && (file=open(argv[1],0)) < 0) data/9base-6/tail/tail.c:178: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[Bsize]; data/9base-6/tail/tail.c:203: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[Bsize]; data/9base-6/tail/tail.c:340:10: [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). count = atol(s); data/9base-6/tail/tail.c:351: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[ERRMAX]; data/9base-6/tee/tee.c:12: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 in[8192]; data/9base-6/tee/tee.c:45: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). openf[n] = open(argv[0], OWRITE); data/9base-6/tr/tr.c:22: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 wbuf[4096]; data/9base-6/tr/tr.c:211: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 buf[4096]; data/9base-6/tr/tr.c:218:5: [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, buf+j, n-j); data/9base-6/tr/tr.c:240: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[UTFmax]; data/9base-6/tr/tr.c:248: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(wptr, buf, n); data/9base-6/troff/dwbinit.c:156: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 buf[200]; data/9base-6/troff/dwbinit.c:170:16: [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). if ( (fp = fopen(DWBCONFIG, "r")) != NULL ) { data/9base-6/troff/dwbinit.c:292: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 buf[512]; data/9base-6/troff/ext.h:13: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. extern char cfname[NSO+1][NS]; data/9base-6/troff/ext.h:16: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. extern char ibuf[IBUFSZ]; data/9base-6/troff/ext.h:17: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. extern char mfiles[NMF][NS]; data/9base-6/troff/ext.h:23: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. extern char xbuf[IBUFSZ]; data/9base-6/troff/fns.h:11: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(char *, int); data/9base-6/troff/fns.h:287:26: [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. int dilook(int a, int b, char t[26][13]); data/9base-6/troff/mbwc.c:137: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[3]; data/9base-6/troff/n1.c:44: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 cfname[NSO+1][NS] = { "stdin" }; /* file name stack */ data/9base-6/troff/n1.c:57: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[100]; data/9base-6/troff/n1.c:105:10: [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). npn = atoi(&argv[0][2]); data/9base-6/troff/n1.c:108:15: [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). bdtab[3] = atoi(&argv[0][2]); data/9base-6/troff/n1.c:113:17: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if (!(stop = atoi(&argv[0][2]))) data/9base-6/troff/n1.c:229: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[100]; data/9base-6/troff/n1.c:295: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 errbuf[200]; data/9base-6/troff/n1.c:382: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 gchtab[NCHARS] = { data/9base-6/troff/n1.c:674: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 ifilt[32] = { 0, 001, 002, 003, 0, 005, 006, 007, 010, 011, 012 }; data/9base-6/troff/n1.c:745: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[100], *p; data/9base-6/troff/n1.c:821:3: [2] (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). Risk is low because the source is a constant string. strcpy(cfname[ifi], "stdin"); data/9base-6/troff/n1.c:831:3: [2] (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). Risk is low because the source is a constant string. strcpy(cfname[ifi], "stdin"); data/9base-6/troff/n1.c:832:22: [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). } else if ((ifile = fopen(unsharp(p), "r")) == NULL) { data/9base-6/troff/n1.c:940:36: [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). if (skip() || !getname() || (fp = fopen(unsharp(nextf), "r")) == NULL || ifi >= NSO) { data/9base-6/troff/n1.c:977: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[1024]; data/9base-6/troff/n1.c:1009:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = fopen(unsharp(nextf), "r")) == NULL) { data/9base-6/troff/n1.c:1071: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 sybuf[NTM]; data/9base-6/troff/n10.c:23: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 buf[100], *t, *obuf; data/9base-6/troff/n10.c:81: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[100], ch[100], s1[100], s2[100]; data/9base-6/troff/n10.c:117: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(ch, "%d", code); data/9base-6/troff/n10.c:143: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 opt[50], cmd[100]; data/9base-6/troff/n10.c:189:12: [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). if ((fp = fopen(unsharp(termtab), "r")) == NULL) { data/9base-6/troff/n10.c:207:28: [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). if (is("bset")) t.bset = atoi(opt); data/9base-6/troff/n10.c:208:37: [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). else if (is("breset")) t.breset = atoi(opt); data/9base-6/troff/n10.c:209:31: [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). else if (is("Hor")) t.Hor = atoi(opt); data/9base-6/troff/n10.c:210:33: [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). else if (is("Vert")) t.Vert = atoi(opt); data/9base-6/troff/n10.c:211:39: [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). else if (is("Newline")) t.Newline = atoi(opt); data/9base-6/troff/n10.c:212:33: [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). else if (is("Char")) t.Char = atoi(opt); data/9base-6/troff/n10.c:213:29: [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). else if (is("Em")) t.Em = atoi(opt); data/9base-6/troff/n10.c:214:41: [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). else if (is("Halfline")) t.Halfline = atoi(opt); data/9base-6/troff/n10.c:215:31: [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). else if (is("Adj")) t.Adj = atoi(opt); data/9base-6/troff/n2.c:23: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 obuf[2*BUFSIZ]; data/9base-6/troff/n2.c:298: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[NTM]; data/9base-6/troff/n3.c:85: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. contabp = (Contab *) memcpy((char *) contabp, (char *)contab, data/9base-6/troff/n4.c:28: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[NTM]; /* for \n(.S */ data/9base-6/troff/n4.c:144:6: [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[j], "%ld", tabtab[i] & TABMASK); data/9base-6/troff/n4.c:147: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(&buf[j], "uR"); data/9base-6/troff/n4.c:149: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(&buf[j], "uC"); data/9base-6/troff/n4.c:151: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(&buf[j], "uL"); data/9base-6/troff/n4.c:216: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. numtabp = (Numtab *) memcpy((char *)numtabp, (char *)numtab, data/9base-6/troff/n4.c:550: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 err_buf[40]; data/9base-6/troff/n5.c:412:23: [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). if( (fcache[i].fp = fopen(unsharp(nextf), "w")) == NULL) { data/9base-6/troff/n5.c:425: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 tmbuf[NTM]; data/9base-6/troff/n8.c:313: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. extern char bxh[26][13], bxxh[26][13], xxh[26][13], xhx[26][13], hxx[26][13]; data/9base-6/troff/n8.c:346: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. dilook(int a, int b, char t[26][13]) data/9base-6/troff/n8.c:367: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 pats[50000]; /* size ought to be computed dynamically */ data/9base-6/troff/n8.c:369: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 *trie[27*27]; /* english-specific sizes */ data/9base-6/troff/n8.c:389: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 w[500+1], *np, *pp, *wp, *xpp, *xwp; data/9base-6/troff/n8.c:468: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[200], buf1[200]; data/9base-6/troff/n8.c:470:12: [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). if ((fp = fopen(unsharp(TEXHYPHENS), "r")) == NULL data/9base-6/troff/n8.c:471:12: [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(unsharp(DWBalthyphens), "r")) == NULL) { data/9base-6/troff/n8.c:494: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 num[500], *onextpat = nextpat; data/9base-6/troff/ni.c:6: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 termtab[NS]; /* term type added in ptinit() */ data/9base-6/troff/ni.c:7: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 fontdir[NS]; /* added in casefp; not used by nroff */ data/9base-6/troff/ni.c:8: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 devname[20]; /* default output device */ data/9base-6/troff/ni.c:33:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nextf[NS] = TMACDIR; data/9base-6/troff/ni.c:34:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char mfiles[NMF][NS]; data/9base-6/troff/ni.c:257: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 ibuf[IBUFSZ]; data/9base-6/troff/ni.c:258: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 xbuf[IBUFSZ]; data/9base-6/troff/t10.c:27: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[100], *p; data/9base-6/troff/t11.c:6: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 *chnames[MAXCH]; /* chnames[n-ALPHABET] -> name of char n */ data/9base-6/troff/t11.c:24: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 cmd[100], s[100]; data/9base-6/troff/t11.c:27: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). if ((fin = fopen(unsharp(name), "r")) == NULL) data/9base-6/troff/t11.c:65: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[300], buf2[300]; data/9base-6/troff/t11.c:68:12: [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). if ((fp = fopen(unsharp(name), "r")) == NULL) data/9base-6/troff/t11.c:97: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[100], ch[100], s1[100], s2[100], s3[100], cmd[300]; data/9base-6/troff/t11.c:103: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). if ((fin = fopen(unsharp(name), "r")) == NULL) data/9base-6/troff/t11.c:152: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(ch, "%d", code); data/9base-6/troff/t11.c:242: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 temp[200]; data/9base-6/troff/t6.c:101:7: [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). i = atoi(np+1); /* sscanf(np+1, "%d", &i); */ data/9base-6/troff/t6.c:221: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 temp[50]; data/9base-6/troff/t6.c:253: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 temp[10]; data/9base-6/troff/t6.c:261:2: [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(temp, "%d", n); /* convert into "#n" */ data/9base-6/troff/t6.c:714: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 pathname[NS], shortname[NS], *sl; data/9base-6/troff/tdef.h:605: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 longname[64]; /* long name of this font (e.g., "Bembo" */ data/9base-6/uniq/uniq.c:38:14: [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). fields = atoi(&argv[1][1]); data/9base-6/uniq/uniq.c:46:14: [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). letters = atoi(&argv[1][1]); data/9base-6/uniq/uniq.c:51:7: [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(argv[1], 0); data/9base-6/yacc/yacc.c:145: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 tokname[NAMESIZE+4]; /* input token name, slop for runes and 0 */ data/9base-6/yacc/yacc.c:179: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 cnames[CNAMSZ]; /* place where token and nonterminal names are stored */ data/9base-6/yacc/yacc.c:527: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 sarr[ISIZE]; data/9base-6/yacc/yacc.c:1181: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 actnm[8], *stemc, *s, dirbuf[128]; data/9base-6/yacc/yacc.c:1228:11: [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(ttempname)) >= 0){ data/9base-6/yacc/yacc.c:1232:11: [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(tactname)) >= 0){ data/9base-6/yacc/yacc.c:1640: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 sar[NAMESIZE+10]; data/9base-6/yacc/yacc.c:2158: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[256]; data/9base-6/awk/lex.c:567: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). for (i = strlen(s)-1; i >= 0; i--) data/9base-6/awk/lib.c:185: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(*FS) >= sizeof(inputFS)) data/9base-6/awk/lib.c:190:13: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c=getc(inf)) == '\n' && c != EOF) /* skip leading \n's */ data/9base-6/awk/lib.c:196:13: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). for (; (c=getc(inf)) != sep && c != EOF; ) { data/9base-6/awk/lib.c:204:12: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((c = getc(inf)) == '\n' || c == EOF) /* 2 in a row */ data/9base-6/awk/lib.c:265:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). n = strlen(r); data/9base-6/awk/lib.c:274: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(inputFS) > 1) { /* it's a regular expression */ data/9base-6/awk/lib.c:400:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). n = strlen(rec); data/9base-6/awk/lib.c:423:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fr, rec, patbeg-rec); data/9base-6/awk/lib.c:446:36: [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 (!adjbuf(&record, &recsize, 1+strlen(p)+r-record, recsize, &r, "recbld 1")) data/9base-6/awk/lib.c:451:37: [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 (!adjbuf(&record, &recsize, 2+strlen(*OFS)+r-record, recsize, &r, "recbld 2")) data/9base-6/awk/main.c:182:12: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((c = getc(yyin)) != EOF) data/9base-6/awk/maketab.c:141:43: [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). names[tok-FIRSTTOKEN] = (char *) malloc(strlen(name)+1); data/9base-6/awk/run.c:449: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). int nsub = strlen(*SUBSEP); data/9base-6/awk/run.c:459: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). if (!adjbuf(&buf, &bufsz, strlen(buf)+strlen(s)+nsub+1, recsize, 0, 0)) data/9base-6/awk/run.c:459:41: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!adjbuf(&buf, &bufsz, strlen(buf)+strlen(s)+nsub+1, recsize, 0, 0)) data/9base-6/awk/run.c:487: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). int nsub = strlen(*SUBSEP); data/9base-6/awk/run.c:506:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!adjbuf(&buf, &bufsz, strlen(buf)+strlen(s)+nsub+1, recsize, 0, 0)) data/9base-6/awk/run.c:506:42: [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 (!adjbuf(&buf, &bufsz, strlen(buf)+strlen(s)+nsub+1, recsize, 0, 0)) data/9base-6/awk/run.c:527: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). int nsub = strlen(*SUBSEP); data/9base-6/awk/run.c:545: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). if (!adjbuf(&buf, &bufsz, strlen(buf)+strlen(s)+nsub+1, recsize, 0, 0)) data/9base-6/awk/run.c:545:41: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!adjbuf(&buf, &bufsz, strlen(buf)+strlen(s)+nsub+1, recsize, 0, 0)) data/9base-6/awk/run.c:728:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). k = countposn(s, strlen(s)) + 1; data/9base-6/awk/run.c:838:15: [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). t = fmt + strlen(fmt); data/9base-6/awk/run.c:883: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). n = strlen(t); data/9base-6/awk/run.c:886: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). adjbuf(&buf, &bufsize, 1+strlen(p)+n+p-buf, recsize, &p, "format"); data/9base-6/awk/run.c:887: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). p += strlen(p); data/9base-6/awk/run.c:895: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). n = strlen(t); data/9base-6/awk/run.c:915: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). p += strlen(p); data/9base-6/awk/run.c:1139: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). n1 = strlen(x->sval); data/9base-6/awk/run.c:1140: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). n2 = strlen(y->sval); data/9base-6/awk/run.c:1223: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). if ((*s != '\0' && strlen(fs) > 1) || arg3type == REGEXPR) { /* reg expr */ data/9base-6/awk/run.c:1461:31: [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). u = (Awkfloat) countposn(p, strlen(p)); break; data/9base-6/awk/run.c:1760:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). adjbuf(&buf, &bufsz, 1+strlen(sptr)+pb-buf, 0, &pb, "sub"); data/9base-6/awk/run.c:1857: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). adjbuf(&buf, &bufsz, 1+strlen(sptr)+pb-buf, 0, &pb, "gsub"); data/9base-6/awk/tran.c:383:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). p = (char *) malloc(strlen(s)+1); data/9base-6/awk/tran.c:396: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). if ((buf = (char *) malloc(strlen(s)+3)) == NULL) data/9base-6/basename/basename.c:35: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). n = strlen(pr)-strlen(argv[2]); data/9base-6/basename/basename.c:35: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). n = strlen(pr)-strlen(argv[2]); data/9base-6/cat/cat.c:10:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while((n=read(f, buf, (long)sizeof buf))>0) data/9base-6/cleanname/cleanname.c:32: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). name = malloc(strlen(argv[i])+1+strlen(dir)+1); data/9base-6/cleanname/cleanname.c:32:36: [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). name = malloc(strlen(argv[i])+1+strlen(dir)+1); data/9base-6/cmp/cmp.c:61:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(f1, b1s, &buf1[BUF] - b1s); data/9base-6/cmp/cmp.c:67:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(f2, b2s, &buf2[BUF] - b2s); data/9base-6/dd/dd.c:228:3: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(ibf, ibuf, ibs); data/9base-6/dd/dd.c:240:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ibc = read(ibf, ibuf, ibs); data/9base-6/diff/diffdir.c:31:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). cp[nitems] = MALLOC(char, strlen((db+n)->name)+1); data/9base-6/diff/diffreg.c:339:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(f1, b1s, &buf1[BUF] - b1s); data/9base-6/diff/diffreg.c:345:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(f2, b2s, &buf2[BUF] - b2s); data/9base-6/diff/main.c:68: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(path) + strlen(name) > MAXPATHLEN) { data/9base-6/diff/main.c:68: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). if (strlen(path) + strlen(name) > MAXPATHLEN) { data/9base-6/diff/main.c:93:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((i = read(input, buf, sizeof(buf))) > 0) { data/9base-6/echo/echo.c:17: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). len += strlen(argv[i])+1; data/9base-6/echo/echo.c:26: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). p += strlen(p); data/9base-6/ed/ed.c:725:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(0, s+i, 1) <= 0) data/9base-6/ed/ed.c:1065:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(tfile, buf, BLKSIZE); data/9base-6/fmt/fmt.c:175:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). n = strlen(s); data/9base-6/fortune/fortune.c:61:3: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(ix, off, sizeof(off)); data/9base-6/grep/main.c:134:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fid, u.u.buf, sizeof(u.u.buf)); data/9base-6/hoc/symbol.c:25: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). sp->name = emalloc(strlen(s)+1); /* +1 for '\0' */ data/9base-6/lib9/_p9dialparse.c:97: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(host)+1 > sizeof sockun->sun_path){ data/9base-6/lib9/_p9dir.c:132: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). if(*str + strlen(s)+1 > estr) data/9base-6/lib9/_p9dir.c:137: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). *str += strlen(*str)+1; data/9base-6/lib9/_p9dir.c:140: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). sz += strlen(s)+1; data/9base-6/lib9/_p9dir.c:154: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). sz += strlen(s)+1; data/9base-6/lib9/_p9dir.c:156: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). if(*str+strlen(s)+1 > estr) data/9base-6/lib9/_p9dir.c:161:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). *str += strlen(*str)+1; data/9base-6/lib9/_p9dir.c:177: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). sz += strlen(s)+1; data/9base-6/lib9/_p9dir.c:179: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). if(*str + strlen(s)+1 > estr) data/9base-6/lib9/_p9dir.c:184: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). *str += strlen(*str)+1; data/9base-6/lib9/_p9translate.c:31: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). olen = strlen(replace[i].old); data/9base-6/lib9/_p9translate.c:35: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). nlen = strlen(replace[i].new); data/9base-6/lib9/_p9translate.c:36: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(old)+nlen-olen; data/9base-6/lib9/_p9translate.c:42: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). assert(strlen(new) == len); data/9base-6/lib9/await.c:109: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). return strlen(str); data/9base-6/lib9/await.c:115: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). return strlen(str); data/9base-6/lib9/bio/bgetc.c:26:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). i = read(bp->fid, bp->bbuf, bp->bsize); data/9base-6/lib9/bio/brdline.c:48:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). j = read(bp->fid, ip, bp->bsize-i); data/9base-6/lib9/bio/brdstr.c:68:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). j = read(bp->fid, ip, bp->bsize-i); data/9base-6/lib9/bio/bread.c:22:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). i = read(bp->fid, bp->bbuf, bp->bsize); data/9base-6/lib9/cistrstr.c:15:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). n = strlen(sub); data/9base-6/lib9/convD2M.c:27: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). ns += strlen(sv[i]); data/9base-6/lib9/convD2M.c:67: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). nsv[i] = strlen(sv[i]); data/9base-6/lib9/convS2M.c:17:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). n = strlen(s); data/9base-6/lib9/convS2M.c:45: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 BIT16SZ+strlen(s); data/9base-6/lib9/ctime.c:61:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ct->zone, ti.zone, sizeof ct->zone); data/9base-6/lib9/dial.c:126: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). if(strlen(unix)+1 > sizeof su.sun_path){ data/9base-6/lib9/dirmodefmt.c:19:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(s, modes[m], 3); data/9base-6/lib9/fcallfmt.c:213: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). return strlen(ans); data/9base-6/lib9/fmt/dofmt.c:268:35: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return __fmtcpy(f, s, utflen(s), strlen(s)); data/9base-6/lib9/fmt/dofmt.c:430: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). bytelen = strlen(thousands); data/9base-6/lib9/fmt/fltfmt.c:378:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return __fmtcpy(fmt, s, strlen(s), strlen(s)); data/9base-6/lib9/fmt/fltfmt.c:378:38: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return __fmtcpy(fmt, s, strlen(s), strlen(s)); data/9base-6/lib9/fmt/fltfmt.c:480: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). sufwid = strlen(suf); data/9base-6/lib9/netcrypt.c:10:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy((char*)buf, chal, 7); data/9base-6/lib9/quote.c:44: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). memmove(s, t, strlen(t)+1); data/9base-6/lib9/readcons.c:54:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd, line, 1); data/9base-6/lib9/readcons.c:80: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(s) > 0) data/9base-6/lib9/readcons.c:81: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). s[strlen(s)-1] = 0; data/9base-6/lib9/readcons.c:89: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). l = strlen(s); data/9base-6/lib9/readn.c:12:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). m = read(f, a+t, n-t); data/9base-6/lib9/regex/regcomp.c:478:48: [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). pp = malloc(sizeof(Reprog) + 6*sizeof(Reinst)*strlen(s)); data/9base-6/lib9/regex/regerror.c:11:2: [1] (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). Risk is low because the source is a constant character. strcat(buf, "\n"); data/9base-6/lib9/regex/regerror.c:12: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). write(2, buf, strlen(buf)); data/9base-6/lib9/searchpath.c:38: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). l = strlen(p)+1+strlen(name)+1; data/9base-6/lib9/searchpath.c:38: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). l = strlen(p)+1+strlen(name)+1; data/9base-6/lib9/searchpath.c:50:4: [1] (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). Risk is low because the source is a constant character. strcat(s, "/"); data/9base-6/lib9/sec/md5pickle.c:35:45: [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). s->blen = dec64(s->buf, sizeof(s->buf), p, strlen(p)); data/9base-6/lib9/sec/sha1pickle.c:34:45: [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). s->blen = dec64(s->buf, sizeof(s->buf), p, strlen(p)); data/9base-6/lib9/strdup.c:10: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). l = strlen(s); data/9base-6/lib9/syslog.c:101:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(p, ctim+4, 15); data/9base-6/lib9/testprint.c:9: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). c = argv[1][strlen(argv[1])-1]; data/9base-6/lib9/truerand.c:15:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(randfd < 0 || read(randfd, buf, 1) != 1) data/9base-6/lib9/unsharp.c:28: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). olen = strlen(replace[i].old); data/9base-6/lib9/unsharp.c:32: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). nlen = strlen(replace[i].new); data/9base-6/lib9/unsharp.c:33: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(old)+nlen-olen; data/9base-6/lib9/unsharp.c:40: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). assert(strlen(new) == len); data/9base-6/lib9/utf/utfutf.c:36: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). n2 = strlen(s2); data/9base-6/lib9/wait.c:18: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). l = strlen(fld[4])+1; data/9base-6/ls/ls.c:188: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). n = strlen(db->uid); data/9base-6/ls/ls.c:192: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). n += strlen(db->gid); data/9base-6/ls/ls.c:220: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). for(i=2+strlen(db->muid); i<mwidth; i++) data/9base-6/ls/ls.c:235: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). (int)(glwidth-strlen(db->gid)), db->length, data/9base-6/mk/archive.c:34:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). m = read(f, a+t, n-t); data/9base-6/mk/archive.c:103:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while(read(fd, (char *)&h, sizeof(h)) == sizeof(h)){ data/9base-6/mk/archive.c:136:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(fd, buf, SARMAG) != SARMAG){ data/9base-6/mk/archive.c:176:25: [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(*p != ' ' || i >= strlen(strings)) data/9base-6/mk/archive.c:190:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(name, h.name, sizeof(h.name)); data/9base-6/mk/archive.c:219: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(file) < 2 || strcmp(file+strlen(file)-2, ".a") != 0) data/9base-6/mk/archive.c:219: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). if(strlen(file) < 2 || strcmp(file+strlen(file)-2, ".a") != 0) data/9base-6/mk/archive.c:225:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(fd, buf, SARMAG) != SARMAG){ data/9base-6/mk/main.c:48:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). bufcpy(buf, argv[0], strlen(argv[0])); data/9base-6/mk/main.c:73:25: [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). bufcpy(buf, argv[0], strlen(argv[0])); data/9base-6/mk/main.c:100:33: [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). bufcpy(whatif, &argv[0][2], strlen(&argv[0][2])); data/9base-6/mk/main.c:104:33: [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). bufcpy(whatif, &argv[0][0], strlen(&argv[0][0])); data/9base-6/mk/main.c:131:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). bufcpy(buf, argv[i], strlen(argv[i])); data/9base-6/mk/main.c:161:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). bufcpy(buf, argv[i], strlen(argv[i])); data/9base-6/mk/match.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). n = strlen(name)-strlen(template+1); data/9base-6/mk/match.c:19:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). n = strlen(name)-strlen(template+1); data/9base-6/mk/match.c:24:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(stem, name, n); data/9base-6/mk/run.c:64:35: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). Bwrite(&bout, buf->start, (long)strlen(buf->start)); data/9base-6/mk/shprint.c:97: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). bufcpy(buf, s, strlen(s)); data/9base-6/mk/unix.c:173: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). p = cmd+strlen(cmd); data/9base-6/mk/unix.c:189:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(out[0], buf->current, buf->end-buf->current); data/9base-6/mk/varsub.c:178:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). bufcpy(buf, w->s, strlen(w->s)); data/9base-6/mk/varsub.c:193:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). bufcpy(buf, w->s, strlen(w->s)); data/9base-6/mk/varsub.c:194:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). bufcpy(buf, d->s, strlen(d->s)); data/9base-6/mk/varsub.c:232: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). n = strlen(w->s); data/9base-6/mk/varsub.c:240: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). *nmid = strlen(s)-n; /* size of remainder of source */ data/9base-6/mk/varsub.c:243: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). n = strlen(w->s); data/9base-6/mk/word.c:136: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). bufcpy(b, w->s, strlen(w->s)); data/9base-6/mk/word.c:143:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). bufcpy(b, tail->s, strlen(tail->s)); data/9base-6/mk/word.c:144: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). bufcpy(b, w->s, strlen(w->s)); data/9base-6/mk/word.c:168: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). bufcpy(b, tail->s, strlen(tail->s)); data/9base-6/pbd/pbd.c:17: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). write(1, p, strlen(p)); data/9base-6/rc/exec.c:502: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). len+=1+strlen(ap->word); data/9base-6/rc/exec.c:561: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). buf = emalloc(strlen(lp->word)+strlen(rp->word)+1); data/9base-6/rc/exec.c:561:33: [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). buf = emalloc(strlen(lp->word)+strlen(rp->word)+1); data/9base-6/rc/exec.c:673:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for(p = a;p;p = p->next) n+=strlen(p->word); data/9base-6/rc/exec.c:678:4: [1] (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). Risk is low because the source is a constant character. strcat(s, " "); data/9base-6/rc/exec.c:861: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). int n = strlen(s); data/9base-6/rc/exec.c:862:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(v, s, NSTATUS); data/9base-6/rc/exec.c:865:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(v+n+1, t, NSTATUS-n-1); data/9base-6/rc/exec.c:878:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(status, getstatus(), NSTATUS); data/9base-6/rc/havefork.c:208:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). inttoascii(name+strlen(name), mainfd); data/9base-6/rc/havefork.c:251: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). n = strlen(buf); data/9base-6/rc/haventfork.c:192: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). nc = strlen(path->word); data/9base-6/rc/haventfork.c:196:5: [1] (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). Risk is low because the source is a constant character. strcat(file, "/"); data/9base-6/rc/haventfork.c:199: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). if(nc+strlen(argv[1])<sizeof(file)){ data/9base-6/rc/lex.c:203:4: [1] (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). Risk is low because the source is a constant character. strcpy(tok, "^"); data/9base-6/rc/lex.c:224:3: [1] (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). Risk is low because the source is a constant character. strcpy(tok, "$"); data/9base-6/rc/lex.c:233:3: [1] (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). Risk is low because the source is a constant character. strcpy(tok, "&"); data/9base-6/rc/plan9ish.c:156: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). len = strlen(s); data/9base-6/rc/plan9ish.c:172: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); data/9base-6/rc/plan9ish.c:299: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). nchr+=strlen(v->name)+1; data/9base-6/rc/plan9ish.c:301: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). nchr+=strlen(a->word)+1; data/9base-6/rc/plan9ish.c:305: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). nchr+=strlen(v->name)+strlen(v->fn[v->pc-1].s)+8; data/9base-6/rc/plan9ish.c:305: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). nchr+=strlen(v->name)+strlen(v->fn[v->pc-1].s)+8; data/9base-6/rc/plan9ish.c:357: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). nc=strlen(path->word); data/9base-6/rc/plan9ish.c:361:5: [1] (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). Risk is low because the source is a constant character. strcat(file, "/"); data/9base-6/rc/plan9ish.c:364: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). if(nc+strlen(argv[1])<1024){ data/9base-6/rc/plan9ish.c:455: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). if(strncmp(s, syssigname[i], strlen(syssigname[i]))==0){ data/9base-6/rc/simple.c:149:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). write(wdirfd, word, strlen(word)); data/9base-6/rc/simple.c:172:5: [1] (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). Risk is low because the source is a constant character. strcat(dir, "/"); data/9base-6/rc/simple.c:175: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(cdpath->word) data/9base-6/rc/simple.c:300: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). len+=1+strlen(ap->word); data/9base-6/rc/simple.c:359:4: [1] (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). Risk is low because the source is a constant character. strcat(file, "/"); data/9base-6/rc/simple.c:405: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(letter)==1){ data/9base-6/rc/simple.c:471:7: [1] (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). Risk is low because the source is a constant character. strcat(file, "/"); data/9base-6/rc/unixcrap.c:196:3: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(n); data/9base-6/rc/unixcrap.c:200:6: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). n = umask(0); data/9base-6/rc/unixcrap.c:201:2: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(n); data/9base-6/rc/unixcrap.c:225:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while((n = read(fd, buf, cnt)) == -1) data/9base-6/rc/var.c:137: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). len+=1+strlen(ap->word); data/9base-6/read/read.c:18:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd, &c, 1); data/9base-6/sam/buff.c:238:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd, p+m, Maxblock); data/9base-6/sam/cmd.c:96:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(0, buf+nbuf, 1); data/9base-6/sam/error.c:143:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). Write(2, s, strlen(s)); data/9base-6/sam/io.c:94:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). for(nt = 0; (n = read(io, buf+b, BLOCKSIZE-b))>0; nt+=(r-genbuf)){ data/9base-6/sam/io.c:154: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). m = strlen(c); data/9base-6/sam/mesg.c:124:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nleft = read(0, (char *)buf, sizeof buf); data/9base-6/sam/mesg.c:484: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). i = strlen(c); data/9base-6/sam/mesg.c:557:15: [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). pm->ndata = strlen(pm->data); data/9base-6/sam/mesg.c:679: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). i = strlen(c); data/9base-6/sam/multi.c:59: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). if(strlen(s) > 0) data/9base-6/sam/plan9.c:60:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(fd<0 || read(fd, user, sizeof user-1)<=0) data/9base-6/sam/sam.c:150:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, c, sizeof buf-1); data/9base-6/sam/sam.c:243:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, t, sizeof buf-1); data/9base-6/sam/sam.c:529: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). write(fd, s, strlen(s)); data/9base-6/sam/shell.c:88: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). Write(pipe2[1], c, strlen(c)); data/9base-6/sam/shell.c:152:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if((n=read(f, buf, sizeof buf-1)) > 0){ data/9base-6/sam/sys.c:33:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(f, (char *)a, n)!=n) { data/9base-6/sam/xec.c:407: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). Write(1, c, strlen(c)); data/9base-6/seq/seq.c:37: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). w = dp==0? strlen(buf): dp-buf; data/9base-6/seq/seq.c:38: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). p = dp==0? 0: strlen(strchr(buf,'.')+1); data/9base-6/seq/seq.c:61: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). if(format[strlen(format)-1] != '\n'){ data/9base-6/sha1sum/sha1sum.c:27:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while((n = read(fd, buf, sizeof buf)) > 0) data/9base-6/sort/sort.c:361: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). if(strlen(dir) >= nelem(file)-20) { data/9base-6/split/split.c:74:42: [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(!(exp = regcomp(iflag? fold(pattern,strlen(pattern)): pattern))) data/9base-6/split/split.c:134:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(name, match[1].s.sp, len); data/9base-6/tail/tail.c:316:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int r = read(file, buf, n); data/9base-6/tee/tee.c:60:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read(0, in, sizeof in); data/9base-6/test/test.c:327: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). if ((len = strlen(s1)) != 0) data/9base-6/test/test.c:329: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). if ((len = strlen(s2)) != 0) data/9base-6/tr/tr.c:220:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd, &buf[i], sizeof(buf)-i); data/9base-6/troff/dwbinit.c:171: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(DWBENV); data/9base-6/troff/dwbinit.c:180: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). if ( (home = malloc(strlen(path)+1)) != NULL ) data/9base-6/troff/dwbinit.c:239: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). plen = strlen(prefix); data/9base-6/troff/dwbinit.c:250: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). length += plen + 1 + strlen(value); /* +1 is for the '/' */ data/9base-6/troff/dwbinit.c:273: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). if ( strlen(path) >= paths->length ) { data/9base-6/troff/dwbinit.c:293: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). int len = strlen(DWBPREFIX); data/9base-6/troff/dwbinit.c:308: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). if ( strlen(home) + strlen(path+len) < length ) { data/9base-6/troff/dwbinit.c:308: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). if ( strlen(home) + strlen(path+len) < length ) { data/9base-6/troff/fns.h:12:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int read(int, char *, int); data/9base-6/troff/n1.c:117: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). sprintf(buf + strlen(buf), ".nr %c %s\n", data/9base-6/troff/n1.c:714:9: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). i = getc(ifile); data/9base-6/troff/n1.c:749:12: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((c = getc(fp)) == EOF) data/9base-6/troff/n10.c:29: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). if (mbtowc(&wc, s, strlen(s)) > 1) { /* it's multibyte, */ data/9base-6/troff/n10.c:103: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(ch) == 1) { /* it's ascii */ data/9base-6/troff/n10.c:110:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). } else if (mbtowc(&wc, ch, strlen(ch)) > 1) { data/9base-6/troff/n10.c:170:3: [1] (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). Risk is low because the source is a constant character. strcpy(fontdir, ""); data/9base-6/troff/n10.c:548:2: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(2, &junk, 1); data/9base-6/troff/n2.c:128: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(chn+1) == 2) data/9base-6/troff/n2.c:188: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). fwrite(t.twinit, strlen(t.twinit), 1, ptid); data/9base-6/troff/n2.c:310: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). j = strlen(buf); data/9base-6/troff/n4.c:145: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). j = strlen(buf); data/9base-6/troff/n5.c:476: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 ((j = strlen(p+1)) == 2) data/9base-6/troff/n5.c:485: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). j = strlen(&tmbuf[i]); data/9base-6/troff/n5.c:840:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(0, &onechar, 1) == 1) { data/9base-6/troff/n8.c:388:16: [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. int nw, i, k, equal, cnt[500]; data/9base-6/troff/n8.c:415:8: [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. if (equal) { data/9base-6/troff/n8.c:515: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). nextpat += strlen(nextpat) + 1; data/9base-6/troff/t11.c:16:28: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define skipline(f) while (getc(f) != '\n') data/9base-6/troff/t11.c:138: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). if (strlen(ch) == 1) { /* it's ascii */ data/9base-6/troff/t11.c:145: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). } else if (mbtowc(&wc, ch, strlen(ch)) > 1) { data/9base-6/troff/t11.c:215:42: [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). chnames[nchnames] = p = (char *) malloc(strlen(s)+1+1); /* type + \0 */ data/9base-6/troff/t6.c:704:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). t = (char *) malloc(strlen(s) + 1); data/9base-6/troff/tdef.h:61:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). #define OUT (obufp += strlen(sprintf(obufp, data/9base-6/troff/tdef.h:325:28: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define skipline(f) while (getc(f) != '\n') data/9base-6/uniq/uniq.c:23:5: [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. int equal(char *b1, char *b2); data/9base-6/uniq/uniq.c:73:7: [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. if(!equal(b1, b2)) { data/9base-6/uniq/uniq.c:82:12: [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. } while(equal(b2, b1)); data/9base-6/uniq/uniq.c:132:1: [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. equal(char *b1, char *b2) data/9base-6/yacc/yacc.c:1242: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(infile)+1+strlen(dirbuf)+1+10; data/9base-6/yacc/yacc.c:1242:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). i = strlen(infile)+1+strlen(dirbuf)+1+10; ANALYSIS SUMMARY: Hits = 942 Lines analyzed = 71602 in approximately 1.58 seconds (45315 lines/second) Physical Source Lines of Code (SLOC) = 61082 Hits@level = [0] 111 [1] 265 [2] 448 [3] 38 [4] 190 [5] 1 Hits@level+ = [0+] 1053 [1+] 942 [2+] 677 [3+] 229 [4+] 191 [5+] 1 Hits/KSLOC@level+ = [0+] 17.2391 [1+] 15.4219 [2+] 11.0835 [3+] 3.74906 [4+] 3.12694 [5+] 0.0163714 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.