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/drawterm-20170818/args.h Examining data/drawterm-20170818/cpu-bl.c Examining data/drawterm-20170818/cpu.c Examining data/drawterm-20170818/drawterm.h Examining data/drawterm-20170818/exportfs/exportfs.c Examining data/drawterm-20170818/exportfs/exportfs.h Examining data/drawterm-20170818/exportfs/exportsrv.c Examining data/drawterm-20170818/gui-osx/alloc.c Examining data/drawterm-20170818/gui-osx/cload.c Examining data/drawterm-20170818/gui-osx/draw.c Examining data/drawterm-20170818/gui-osx/keycodes.h Examining data/drawterm-20170818/gui-osx/load.c Examining data/drawterm-20170818/gui-osx/screen.c Examining data/drawterm-20170818/gui-osx/wstrtoutf.c Examining data/drawterm-20170818/gui-win32/alloc.c Examining data/drawterm-20170818/gui-win32/cload.c Examining data/drawterm-20170818/gui-win32/draw.c Examining data/drawterm-20170818/gui-win32/load.c Examining data/drawterm-20170818/gui-win32/r16.c Examining data/drawterm-20170818/gui-win32/r16.h Examining data/drawterm-20170818/gui-win32/screen.c Examining data/drawterm-20170818/gui-x11/keysym2ucs-x11.c Examining data/drawterm-20170818/gui-x11/keysym2ucs.h Examining data/drawterm-20170818/gui-x11/x11.c Examining data/drawterm-20170818/include/9windows.h Examining data/drawterm-20170818/include/auth.h Examining data/drawterm-20170818/include/authsrv.h Examining data/drawterm-20170818/include/cursor.h Examining data/drawterm-20170818/include/draw.h Examining data/drawterm-20170818/include/dtos.h Examining data/drawterm-20170818/include/fcall.h Examining data/drawterm-20170818/include/ip.h Examining data/drawterm-20170818/include/keyboard.h Examining data/drawterm-20170818/include/lib.h Examining data/drawterm-20170818/include/libc.h Examining data/drawterm-20170818/include/libsec.h Examining data/drawterm-20170818/include/memdraw.h Examining data/drawterm-20170818/include/memlayer.h Examining data/drawterm-20170818/include/mp.h Examining data/drawterm-20170818/include/u.h Examining data/drawterm-20170818/include/unix.h Examining data/drawterm-20170818/include/user.h Examining data/drawterm-20170818/include/x.c Examining data/drawterm-20170818/kern/allocb.c Examining data/drawterm-20170818/kern/cache.c Examining data/drawterm-20170818/kern/chan.c Examining data/drawterm-20170818/kern/dat.h Examining data/drawterm-20170818/kern/data.c Examining data/drawterm-20170818/kern/dev.c Examining data/drawterm-20170818/kern/devaudio-none.c Examining data/drawterm-20170818/kern/devaudio-sun.c Examining data/drawterm-20170818/kern/devaudio-unix.c Examining data/drawterm-20170818/kern/devaudio.c Examining data/drawterm-20170818/kern/devaudio.h Examining data/drawterm-20170818/kern/devcons.c Examining data/drawterm-20170818/kern/devdraw.c Examining data/drawterm-20170818/kern/devfs-posix.c Examining data/drawterm-20170818/kern/devfs-win32.c Examining data/drawterm-20170818/kern/devip-posix.c Examining data/drawterm-20170818/kern/devip-win32.c Examining data/drawterm-20170818/kern/devip.c Examining data/drawterm-20170818/kern/devip.h Examining data/drawterm-20170818/kern/devlfd.c Examining data/drawterm-20170818/kern/devmnt.c Examining data/drawterm-20170818/kern/devmouse.c Examining data/drawterm-20170818/kern/devpipe.c Examining data/drawterm-20170818/kern/devroot.c Examining data/drawterm-20170818/kern/devssl.c Examining data/drawterm-20170818/kern/devtab.c Examining data/drawterm-20170818/kern/devtls.c Examining data/drawterm-20170818/kern/error.c Examining data/drawterm-20170818/kern/error.h Examining data/drawterm-20170818/kern/exportfs.c Examining data/drawterm-20170818/kern/fns.h Examining data/drawterm-20170818/kern/netif.h Examining data/drawterm-20170818/kern/parse.c Examining data/drawterm-20170818/kern/pgrp.c Examining data/drawterm-20170818/kern/posix.c Examining data/drawterm-20170818/kern/procinit.c Examining data/drawterm-20170818/kern/qio.c Examining data/drawterm-20170818/kern/qlock.c Examining data/drawterm-20170818/kern/rendez.c Examining data/drawterm-20170818/kern/rwlock.c Examining data/drawterm-20170818/kern/screen.h Examining data/drawterm-20170818/kern/sleep.c Examining data/drawterm-20170818/kern/smalloc.c Examining data/drawterm-20170818/kern/stub.c Examining data/drawterm-20170818/kern/syscall.c Examining data/drawterm-20170818/kern/sysfile.c Examining data/drawterm-20170818/kern/sysproc.c Examining data/drawterm-20170818/kern/term.c Examining data/drawterm-20170818/kern/uart.c Examining data/drawterm-20170818/kern/waserror.c Examining data/drawterm-20170818/kern/win32.c Examining data/drawterm-20170818/latin1.c Examining data/drawterm-20170818/libauth/attr.c Examining data/drawterm-20170818/libauth/auth_attr.c Examining data/drawterm-20170818/libauth/auth_challenge.c Examining data/drawterm-20170818/libauth/auth_getuserpasswd.c Examining data/drawterm-20170818/libauth/auth_proxy.c Examining data/drawterm-20170818/libauth/auth_respond.c Examining data/drawterm-20170818/libauth/auth_rpc.c Examining data/drawterm-20170818/libauth/auth_userpasswd.c Examining data/drawterm-20170818/libauth/authlocal.h Examining data/drawterm-20170818/libauth/httpauth.c Examining data/drawterm-20170818/libauthsrv/_asgetticket.c Examining data/drawterm-20170818/libauthsrv/_asrdresp.c Examining data/drawterm-20170818/libauthsrv/authdial.c Examining data/drawterm-20170818/libauthsrv/convA2M.c Examining data/drawterm-20170818/libauthsrv/convM2A.c Examining data/drawterm-20170818/libauthsrv/convM2PR.c Examining data/drawterm-20170818/libauthsrv/convM2T.c Examining data/drawterm-20170818/libauthsrv/convM2TR.c Examining data/drawterm-20170818/libauthsrv/convPR2M.c Examining data/drawterm-20170818/libauthsrv/convT2M.c Examining data/drawterm-20170818/libauthsrv/convTR2M.c Examining data/drawterm-20170818/libauthsrv/nvcsum.c Examining data/drawterm-20170818/libauthsrv/opasstokey.c Examining data/drawterm-20170818/libauthsrv/passtokey.c Examining data/drawterm-20170818/libauthsrv/readnvram.c Examining data/drawterm-20170818/libc/charstod.c Examining data/drawterm-20170818/libc/cleanname.c Examining data/drawterm-20170818/libc/convD2M.c Examining data/drawterm-20170818/libc/convM2D.c Examining data/drawterm-20170818/libc/convM2S.c Examining data/drawterm-20170818/libc/convS2M.c Examining data/drawterm-20170818/libc/crypt.c Examining data/drawterm-20170818/libc/dial.c Examining data/drawterm-20170818/libc/dirfstat.c Examining data/drawterm-20170818/libc/dirfwstat.c Examining data/drawterm-20170818/libc/dirmodefmt.c Examining data/drawterm-20170818/libc/dirstat.c Examining data/drawterm-20170818/libc/dirwstat.c Examining data/drawterm-20170818/libc/dofmt.c Examining data/drawterm-20170818/libc/dorfmt.c Examining data/drawterm-20170818/libc/encodefmt.c Examining data/drawterm-20170818/libc/fcallfmt.c Examining data/drawterm-20170818/libc/fltfmt.c Examining data/drawterm-20170818/libc/fmt.c Examining data/drawterm-20170818/libc/fmtdef.h Examining data/drawterm-20170818/libc/fmtfd.c Examining data/drawterm-20170818/libc/fmtfdflush.c Examining data/drawterm-20170818/libc/fmtlock.c Examining data/drawterm-20170818/libc/fmtprint.c Examining data/drawterm-20170818/libc/fmtquote.c Examining data/drawterm-20170818/libc/fmtrune.c Examining data/drawterm-20170818/libc/fmtstr.c Examining data/drawterm-20170818/libc/fmtvprint.c Examining data/drawterm-20170818/libc/fprint.c Examining data/drawterm-20170818/libc/frand.c Examining data/drawterm-20170818/libc/getfields.c Examining data/drawterm-20170818/libc/getpid.c Examining data/drawterm-20170818/libc/lnrand.c Examining data/drawterm-20170818/libc/lock.c Examining data/drawterm-20170818/libc/lrand.c Examining data/drawterm-20170818/libc/mallocz.c Examining data/drawterm-20170818/libc/nan.h Examining data/drawterm-20170818/libc/nan64.c Examining data/drawterm-20170818/libc/netmkaddr.c Examining data/drawterm-20170818/libc/nrand.c Examining data/drawterm-20170818/libc/nsec.c Examining data/drawterm-20170818/libc/pow10.c Examining data/drawterm-20170818/libc/print.c Examining data/drawterm-20170818/libc/pushssl.c Examining data/drawterm-20170818/libc/pushtls.c Examining data/drawterm-20170818/libc/rand.c Examining data/drawterm-20170818/libc/read9pmsg.c Examining data/drawterm-20170818/libc/readn.c Examining data/drawterm-20170818/libc/rune.c Examining data/drawterm-20170818/libc/runefmtstr.c Examining data/drawterm-20170818/libc/runeseprint.c Examining data/drawterm-20170818/libc/runesmprint.c Examining data/drawterm-20170818/libc/runesnprint.c Examining data/drawterm-20170818/libc/runesprint.c Examining data/drawterm-20170818/libc/runestrcat.c Examining data/drawterm-20170818/libc/runestrchr.c Examining data/drawterm-20170818/libc/runestrcmp.c Examining data/drawterm-20170818/libc/runestrcpy.c Examining data/drawterm-20170818/libc/runestrdup.c Examining data/drawterm-20170818/libc/runestrecpy.c Examining data/drawterm-20170818/libc/runestrlen.c Examining data/drawterm-20170818/libc/runestrncat.c Examining data/drawterm-20170818/libc/runestrncmp.c Examining data/drawterm-20170818/libc/runestrncpy.c Examining data/drawterm-20170818/libc/runestrrchr.c Examining data/drawterm-20170818/libc/runestrstr.c Examining data/drawterm-20170818/libc/runetype.c Examining data/drawterm-20170818/libc/runevseprint.c Examining data/drawterm-20170818/libc/runevsmprint.c Examining data/drawterm-20170818/libc/runevsnprint.c Examining data/drawterm-20170818/libc/seprint.c Examining data/drawterm-20170818/libc/smprint.c Examining data/drawterm-20170818/libc/snprint.c Examining data/drawterm-20170818/libc/sprint.c Examining data/drawterm-20170818/libc/strecpy.c Examining data/drawterm-20170818/libc/strtod.c Examining data/drawterm-20170818/libc/strtod.h Examining data/drawterm-20170818/libc/strtoll.c Examining data/drawterm-20170818/libc/sysfatal.c Examining data/drawterm-20170818/libc/time.c Examining data/drawterm-20170818/libc/tokenize.c Examining data/drawterm-20170818/libc/truerand.c Examining data/drawterm-20170818/libc/u16.c Examining data/drawterm-20170818/libc/u32.c Examining data/drawterm-20170818/libc/u64.c Examining data/drawterm-20170818/libc/utf.h Examining data/drawterm-20170818/libc/utfdef.h Examining data/drawterm-20170818/libc/utfecpy.c Examining data/drawterm-20170818/libc/utflen.c Examining data/drawterm-20170818/libc/utfnlen.c Examining data/drawterm-20170818/libc/utfrrune.c Examining data/drawterm-20170818/libc/utfrune.c Examining data/drawterm-20170818/libc/utfutf.c Examining data/drawterm-20170818/libc/vfprint.c Examining data/drawterm-20170818/libc/vseprint.c Examining data/drawterm-20170818/libc/vsmprint.c Examining data/drawterm-20170818/libc/vsnprint.c Examining data/drawterm-20170818/libdraw/alloc.c Examining data/drawterm-20170818/libdraw/arith.c Examining data/drawterm-20170818/libdraw/bytesperline.c Examining data/drawterm-20170818/libdraw/chan.c Examining data/drawterm-20170818/libdraw/defont.c Examining data/drawterm-20170818/libdraw/drawrepl.c Examining data/drawterm-20170818/libdraw/icossin.c Examining data/drawterm-20170818/libdraw/icossin2.c Examining data/drawterm-20170818/libdraw/rectclip.c Examining data/drawterm-20170818/libdraw/rgb.c Examining data/drawterm-20170818/libip/bo.c Examining data/drawterm-20170818/libip/classmask.c Examining data/drawterm-20170818/libip/eipfmt.c Examining data/drawterm-20170818/libip/ipaux.c Examining data/drawterm-20170818/libip/parseip.c Examining data/drawterm-20170818/libmemdraw/alloc.c Examining data/drawterm-20170818/libmemdraw/arc.c Examining data/drawterm-20170818/libmemdraw/arctest.c Examining data/drawterm-20170818/libmemdraw/cload.c Examining data/drawterm-20170818/libmemdraw/cmap.c Examining data/drawterm-20170818/libmemdraw/cread.c Examining data/drawterm-20170818/libmemdraw/defont.c Examining data/drawterm-20170818/libmemdraw/draw.c Examining data/drawterm-20170818/libmemdraw/drawtest.c Examining data/drawterm-20170818/libmemdraw/ellipse.c Examining data/drawterm-20170818/libmemdraw/fillpoly.c Examining data/drawterm-20170818/libmemdraw/hwdraw.c Examining data/drawterm-20170818/libmemdraw/iprint.c Examining data/drawterm-20170818/libmemdraw/line.c Examining data/drawterm-20170818/libmemdraw/load.c Examining data/drawterm-20170818/libmemdraw/mkcmap.c Examining data/drawterm-20170818/libmemdraw/openmemsubfont.c Examining data/drawterm-20170818/libmemdraw/poly.c Examining data/drawterm-20170818/libmemdraw/read.c Examining data/drawterm-20170818/libmemdraw/string.c Examining data/drawterm-20170818/libmemdraw/subfont.c Examining data/drawterm-20170818/libmemdraw/unload.c Examining data/drawterm-20170818/libmemdraw/write.c Examining data/drawterm-20170818/libmemlayer/draw.c Examining data/drawterm-20170818/libmemlayer/lalloc.c Examining data/drawterm-20170818/libmemlayer/layerop.c Examining data/drawterm-20170818/libmemlayer/ldelete.c Examining data/drawterm-20170818/libmemlayer/lhide.c Examining data/drawterm-20170818/libmemlayer/line.c Examining data/drawterm-20170818/libmemlayer/load.c Examining data/drawterm-20170818/libmemlayer/lorigin.c Examining data/drawterm-20170818/libmemlayer/lsetrefresh.c Examining data/drawterm-20170818/libmemlayer/ltofront.c Examining data/drawterm-20170818/libmemlayer/ltorear.c Examining data/drawterm-20170818/libmemlayer/unload.c Examining data/drawterm-20170818/libmp/betomp.c Examining data/drawterm-20170818/libmp/crt.c Examining data/drawterm-20170818/libmp/crttest.c Examining data/drawterm-20170818/libmp/dat.h Examining data/drawterm-20170818/libmp/letomp.c Examining data/drawterm-20170818/libmp/mpadd.c Examining data/drawterm-20170818/libmp/mpaux.c Examining data/drawterm-20170818/libmp/mpcmp.c Examining data/drawterm-20170818/libmp/mpdigdiv.c Examining data/drawterm-20170818/libmp/mpdiv.c Examining data/drawterm-20170818/libmp/mpeuclid.c Examining data/drawterm-20170818/libmp/mpexp.c Examining data/drawterm-20170818/libmp/mpextendedgcd.c Examining data/drawterm-20170818/libmp/mpfmt.c Examining data/drawterm-20170818/libmp/mpinvert.c Examining data/drawterm-20170818/libmp/mpleft.c Examining data/drawterm-20170818/libmp/mpmod.c Examining data/drawterm-20170818/libmp/mpmul.c Examining data/drawterm-20170818/libmp/mprand.c Examining data/drawterm-20170818/libmp/mpright.c Examining data/drawterm-20170818/libmp/mpsub.c Examining data/drawterm-20170818/libmp/mptobe.c Examining data/drawterm-20170818/libmp/mptoi.c Examining data/drawterm-20170818/libmp/mptole.c Examining data/drawterm-20170818/libmp/mptoui.c Examining data/drawterm-20170818/libmp/mptouv.c Examining data/drawterm-20170818/libmp/mptov.c Examining data/drawterm-20170818/libmp/mpvecadd.c Examining data/drawterm-20170818/libmp/mpveccmp.c Examining data/drawterm-20170818/libmp/mpvecdigmuladd.c Examining data/drawterm-20170818/libmp/mpvecsub.c Examining data/drawterm-20170818/libmp/os.h Examining data/drawterm-20170818/libmp/strtomp.c Examining data/drawterm-20170818/libsec/aes.c Examining data/drawterm-20170818/libsec/blowfish.c Examining data/drawterm-20170818/libsec/decodepem.c Examining data/drawterm-20170818/libsec/des.c Examining data/drawterm-20170818/libsec/des3CBC.c Examining data/drawterm-20170818/libsec/des3ECB.c Examining data/drawterm-20170818/libsec/desCBC.c Examining data/drawterm-20170818/libsec/desECB.c Examining data/drawterm-20170818/libsec/desmodes.c Examining data/drawterm-20170818/libsec/dsaalloc.c Examining data/drawterm-20170818/libsec/dsagen.c Examining data/drawterm-20170818/libsec/dsaprimes.c Examining data/drawterm-20170818/libsec/dsaprivtopub.c Examining data/drawterm-20170818/libsec/dsasign.c Examining data/drawterm-20170818/libsec/dsaverify.c Examining data/drawterm-20170818/libsec/egalloc.c Examining data/drawterm-20170818/libsec/egdecrypt.c Examining data/drawterm-20170818/libsec/egencrypt.c Examining data/drawterm-20170818/libsec/eggen.c Examining data/drawterm-20170818/libsec/egprivtopub.c Examining data/drawterm-20170818/libsec/egsign.c Examining data/drawterm-20170818/libsec/egtest.c Examining data/drawterm-20170818/libsec/egverify.c Examining data/drawterm-20170818/libsec/fastrand.c Examining data/drawterm-20170818/libsec/genprime.c Examining data/drawterm-20170818/libsec/genrandom.c Examining data/drawterm-20170818/libsec/gensafeprime.c Examining data/drawterm-20170818/libsec/genstrongprime.c Examining data/drawterm-20170818/libsec/hmac.c Examining data/drawterm-20170818/libsec/hmactest.c Examining data/drawterm-20170818/libsec/md4.c Examining data/drawterm-20170818/libsec/md4test.c Examining data/drawterm-20170818/libsec/md5.c Examining data/drawterm-20170818/libsec/md5block.c Examining data/drawterm-20170818/libsec/md5pickle.c Examining data/drawterm-20170818/libsec/nfastrand.c Examining data/drawterm-20170818/libsec/os.h Examining data/drawterm-20170818/libsec/primetest.c Examining data/drawterm-20170818/libsec/prng.c Examining data/drawterm-20170818/libsec/probably_prime.c Examining data/drawterm-20170818/libsec/rc4.c Examining data/drawterm-20170818/libsec/readcert.c Examining data/drawterm-20170818/libsec/rsaalloc.c Examining data/drawterm-20170818/libsec/rsadecrypt.c Examining data/drawterm-20170818/libsec/rsaencrypt.c Examining data/drawterm-20170818/libsec/rsafill.c Examining data/drawterm-20170818/libsec/rsagen.c Examining data/drawterm-20170818/libsec/rsaprivtopub.c Examining data/drawterm-20170818/libsec/rsatest.c Examining data/drawterm-20170818/libsec/sha1.c Examining data/drawterm-20170818/libsec/sha1block.c Examining data/drawterm-20170818/libsec/sha1pickle.c Examining data/drawterm-20170818/libsec/smallprimes.c Examining data/drawterm-20170818/libsec/smallprimetest.c Examining data/drawterm-20170818/libsec/thumb.c Examining data/drawterm-20170818/libsec/tlshand.c Examining data/drawterm-20170818/libsec/x509.c Examining data/drawterm-20170818/main.c Examining data/drawterm-20170818/posix-386/getcallerpc.c Examining data/drawterm-20170818/posix-386/tas.c Examining data/drawterm-20170818/posix-amd64/getcallerpc.c Examining data/drawterm-20170818/posix-amd64/md5block.c Examining data/drawterm-20170818/posix-amd64/sha1block.c Examining data/drawterm-20170818/posix-amd64/tas.c Examining data/drawterm-20170818/posix-arm/getcallerpc.c Examining data/drawterm-20170818/posix-arm/md5block.c Examining data/drawterm-20170818/posix-arm/sha1block.c Examining data/drawterm-20170818/posix-arm/tas.c Examining data/drawterm-20170818/posix-factotum.c Examining data/drawterm-20170818/posix-mips/getcallerpc.c Examining data/drawterm-20170818/posix-mips/md5block.c Examining data/drawterm-20170818/posix-mips/sha1block.c Examining data/drawterm-20170818/posix-port/getcallerpc.c Examining data/drawterm-20170818/posix-port/md5block.c Examining data/drawterm-20170818/posix-port/sha1block.c Examining data/drawterm-20170818/posix-power/getcallerpc.c Examining data/drawterm-20170818/posix-power/md5block.c Examining data/drawterm-20170818/posix-power/sha1block.c Examining data/drawterm-20170818/posix-power/tas.c Examining data/drawterm-20170818/posix-sun4u/getcallerpc.c Examining data/drawterm-20170818/posix-sun4u/md5block.c Examining data/drawterm-20170818/posix-sun4u/sha1block.c Examining data/drawterm-20170818/readcons.c Examining data/drawterm-20170818/resource.h Examining data/drawterm-20170818/secstore.c Examining data/drawterm-20170818/win32-386/getcallerpc.c Examining data/drawterm-20170818/win32-386/tas.c Examining data/drawterm-20170818/win32-factotum.c FINAL RESULTS: data/drawterm-20170818/kern/devfs-posix.c:279:4: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(path, perm & 0777); data/drawterm-20170818/kern/devfs-posix.c:280:4: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. chown(path, uif->uid, uif->uid); data/drawterm-20170818/kern/devfs-posix.c:295:4: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(path, perm & 0777); data/drawterm-20170818/kern/devfs-posix.c:296:4: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. chown(path, uif->uid, uif->gid); data/drawterm-20170818/kern/devfs-posix.c:430: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(old, d.mode&0777) < 0) data/drawterm-20170818/kern/devfs-win32.c:63:13: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. static int chown(char *path, int uid, int); data/drawterm-20170818/kern/devfs-win32.c:296:4: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(path, perm & 0777); data/drawterm-20170818/kern/devfs-win32.c:297:4: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. chown(path, uif->uid, uif->uid); data/drawterm-20170818/kern/devfs-win32.c:312:4: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(path, perm & 0777); data/drawterm-20170818/kern/devfs-win32.c:313:4: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. chown(path, uif->uid, uif->gid); data/drawterm-20170818/kern/devfs-win32.c:459: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(old, d.mode&0777) < 0) data/drawterm-20170818/kern/devfs-win32.c:657:1: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. chown(char *path, int uid, int perm) data/drawterm-20170818/cpu-bl.c:28:9: [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. #define system csystem data/drawterm-20170818/cpu-bl.c:29:14: [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. static char *system; data/drawterm-20170818/cpu-bl.c:149: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(cmd, p); data/drawterm-20170818/cpu-bl.c:176:26: [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(secstorebuf, s); data/drawterm-20170818/cpu-bl.c:181:27: [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. if((err = rexcall(&data, system, srvname))) data/drawterm-20170818/cpu-bl.c:182:27: [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. fatal(1, "%s: %s", err, system); data/drawterm-20170818/cpu-bl.c:330: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(chall, chall+sizeof chall, getuser()); data/drawterm-20170818/cpu-bl.c:335: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(chall, resp); data/drawterm-20170818/cpu-bl.c:438: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.cuid, tr->uid); data/drawterm-20170818/cpu-bl.c:439: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.suid, tr->uid); data/drawterm-20170818/cpu-bl.c:611: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(tr.hostid, tr.hostid+sizeof tr.hostid, u); data/drawterm-20170818/cpu-bl.c:612: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(tr.uid, tr.uid+sizeof tr.uid, u); data/drawterm-20170818/cpu.c:28:9: [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. #define system csystem data/drawterm-20170818/cpu.c:29:14: [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. static char *system; data/drawterm-20170818/cpu.c:144: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(cmd, p); data/drawterm-20170818/cpu.c:177: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(secstorebuf, s); data/drawterm-20170818/cpu.c:182:27: [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. if((err = rexcall(&data, system, srvname))) data/drawterm-20170818/cpu.c:183:27: [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. fatal(1, "%s: %s", err, system); data/drawterm-20170818/cpu.c:331: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(chall, chall+sizeof chall, getuser()); data/drawterm-20170818/cpu.c:336: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(chall, resp); data/drawterm-20170818/cpu.c:439: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.cuid, tr->uid); data/drawterm-20170818/cpu.c:440: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.suid, tr->uid); data/drawterm-20170818/cpu.c:613: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(tr.hostid, tr.hostid+sizeof tr.hostid, u); data/drawterm-20170818/cpu.c:614: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(tr.uid, tr.uid+sizeof tr.uid, u); data/drawterm-20170818/gui-x11/x11.c:1536: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(clip.buf, data); data/drawterm-20170818/include/lib.h:260: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/drawterm-20170818/kern/chan.c:770: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(up->errstr, Enotdir); data/drawterm-20170818/kern/chan.c:846: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(up->errstr, Edoesnotexist); data/drawterm-20170818/kern/chan.c:850: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(up->errstr, Enotdir); data/drawterm-20170818/kern/chan.c:1150: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(tmperrbuf, up->errstr); data/drawterm-20170818/kern/dev.c:347:13: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. static int access[] = { 0400, 0200, 0600, 0100 }; data/drawterm-20170818/kern/dev.c:357: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. t = access[omode&3]; data/drawterm-20170818/kern/devaudio-sun.c:38: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(cfn, afn); data/drawterm-20170818/kern/devfs-posix.c:438: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, old); data/drawterm-20170818/kern/devfs-posix.c:440: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+1, d.name); data/drawterm-20170818/kern/devfs-posix.c:494: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(path, base); data/drawterm-20170818/kern/devfs-posix.c:496: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(path, uc2name(c)); data/drawterm-20170818/kern/devfs-posix.c:499: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(path, ext); data/drawterm-20170818/kern/devfs-posix.c:524: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, uif->nextname); data/drawterm-20170818/kern/devfs-posix.c:533: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(name, de->d_name); data/drawterm-20170818/kern/devfs-posix.c:591: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(uif->nextname, de); data/drawterm-20170818/kern/devfs-win32.c:450: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, old); data/drawterm-20170818/kern/devfs-win32.c:452: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+1, d.name); data/drawterm-20170818/kern/devfs-win32.c:513: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(path, base); data/drawterm-20170818/kern/devfs-win32.c:515: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(path, uc2name(c)); data/drawterm-20170818/kern/devfs-win32.c:518: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(path, ext); data/drawterm-20170818/kern/devfs-win32.c:541: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, uif->nextname); data/drawterm-20170818/kern/devfs-win32.c:603: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(uif->nextname, de); data/drawterm-20170818/kern/devfs-win32.c:642: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(name, (char*)d->wfd.cFileName); data/drawterm-20170818/kern/devip-win32.c:247: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, host); data/drawterm-20170818/kern/devip.c:168: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->name, name); data/drawterm-20170818/kern/devip.c:567: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(c->owner, user); data/drawterm-20170818/kern/devmnt.c:135:3: [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(buf, buf+sizeof buf, m->version); data/drawterm-20170818/kern/devroot.c:83: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(d->name, name); data/drawterm-20170818/kern/devssl.c:1232: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(cp, e->name); data/drawterm-20170818/kern/devssl.c:1246: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(cp, h->name); data/drawterm-20170818/kern/devtls.c:1714: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(cp, e->name); data/drawterm-20170818/kern/devtls.c:1728: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(cp, h->name); data/drawterm-20170818/kern/devtls.c:2164: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, tag); data/drawterm-20170818/kern/posix.c:96:3: [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(up->errstr, up->errstr+ERRMAX, p); data/drawterm-20170818/kern/procinit.c:35: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->user, eve); data/drawterm-20170818/kern/procinit.c:62: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(p->text, p->text+sizeof p->text, name); data/drawterm-20170818/kern/qio.c:1381: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(q->err, Ehungup); data/drawterm-20170818/kern/qio.c:1408: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(q->err, Ehungup); data/drawterm-20170818/kern/syscall.c:801: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(dir, buf); data/drawterm-20170818/kern/syscall.c:824: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, dir); data/drawterm-20170818/kern/syscall.c:835: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(newdir, buf); data/drawterm-20170818/kern/sysfile.c:1155:3: [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(up->errstr, up->errstr+ERRMAX, buf); data/drawterm-20170818/kern/sysfile.c:1157:3: [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(up->syserrstr, up->syserrstr+ERRMAX, buf); data/drawterm-20170818/kern/win32.c:424:5: [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(buf, buf+nbuf, tab[i].s); data/drawterm-20170818/kern/win32.c:468:2: [4] (shell) ShellExecute: 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. ShellExecute(0, 0, action, arg, 0, SW_SHOWNORMAL); data/drawterm-20170818/libauth/auth_getuserpasswd.c:64: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, f[0]); data/drawterm-20170818/libauth/auth_getuserpasswd.c:67: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, f[1]); data/drawterm-20170818/libauth/auth_respond.c:65: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, s); data/drawterm-20170818/libauth/httpauth.c:27: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(tr.uid, name); data/drawterm-20170818/libauthsrv/readnvram.c:88: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, def); data/drawterm-20170818/libc/dial.c:118: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(besterr, err); data/drawterm-20170818/libc/fltfmt.c:194: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(s2, s1); data/drawterm-20170818/libc/fltfmt.c:209: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(s1, s2); data/drawterm-20170818/libc/strecpy.c:5: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/drawterm-20170818/libsec/x509.c:1666: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(ans, s); data/drawterm-20170818/posix-factotum.c:16: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. #undef access data/drawterm-20170818/posix-factotum.c:27: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/drawterm-20170818/posix-factotum.c:85:20: [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(name == nil || access(name, 0) < 0) data/drawterm-20170818/posix-factotum.c:93: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, name); data/drawterm-20170818/readcons.c:35: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(s, t); data/drawterm-20170818/secstore.c:46:3: [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(buf, buf+sizeof buf, authserver); data/drawterm-20170818/secstore.c:645: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+3, sta); data/drawterm-20170818/cpu-bl.c:114:16: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. user = getenv("USER"); data/drawterm-20170818/cpu-bl.c:118: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. authserver = getenv("auth"); data/drawterm-20170818/cpu-bl.c:121: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. system = getenv("cpu"); data/drawterm-20170818/cpu.c:115: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. user = getenv("USER"); data/drawterm-20170818/cpu.c:117: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. authserver = getenv("auth"); data/drawterm-20170818/cpu.c:120: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. system = getenv("cpu"); data/drawterm-20170818/gui-x11/x11.c:727: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. getenv("DISPLAY")); data/drawterm-20170818/gui-x11/x11.c:892:14: [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. disp_val = getenv("DISPLAY"); data/drawterm-20170818/gui-x11/x11.c:900:14: [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. disp_val = getenv("DISPLAY"); data/drawterm-20170818/gui-x11/x11.c:1394: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. p = getenv("DRAWTERM_ATLOCALCONSOLE"); data/drawterm-20170818/gui-x11/x11.c:1398: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. p = getenv("DISPLAY"); data/drawterm-20170818/kern/devaudio-sun.c:33: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 ((afn = getenv("AUDIODEV")) == nil) data/drawterm-20170818/kern/posix.c:171:2: [3] (random) srandom: 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. srandom(getpid()+fastticks(nil)+ticks()); data/drawterm-20170818/kern/posix.c:187:20: [3] (random) random: 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. ((uchar*)v)[i] = random(); data/drawterm-20170818/libauthsrv/readnvram.c:130: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. nvrfile = getenv("nvram"); data/drawterm-20170818/libauthsrv/readnvram.c:131: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. cputype = getenv("cputype"); data/drawterm-20170818/libauthsrv/readnvram.c:149: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. nvrlen = getenv("nvrlen"); data/drawterm-20170818/libauthsrv/readnvram.c:152: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. nvroff = getenv("nvroff"); data/drawterm-20170818/libc/lrand.c:52:1: [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(long seed) data/drawterm-20170818/libmemdraw/drawtest.c:110:2: [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(seed); data/drawterm-20170818/libsec/tlshand.c:74:8: [3] (random) srandom: 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. uchar srandom[RandomSize]; // server random data/drawterm-20170818/libsec/tlshand.c:91:11: [3] (random) random: 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. uchar random[RandomSize]; data/drawterm-20170818/libsec/tlshand.c:98:11: [3] (random) random: 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. uchar random[RandomSize]; data/drawterm-20170818/libsec/tlshand.c:126:8: [3] (random) srandom: 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. uchar srandom[RandomSize]; // server random data/drawterm-20170818/libsec/tlshand.c:270:111: [3] (random) srandom: 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. static TlsSec* tlsSecInits(int cvers, uchar *csid, int ncsid, uchar *crandom, uchar *ssid, int *nssid, uchar *srandom); data/drawterm-20170818/libsec/tlshand.c:273:68: [3] (random) srandom: 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. static int tlsSecSecretc(TlsSec *sec, uchar *sid, int nsid, uchar *srandom, uchar *cert, int ncert, int vers, uchar **epm, int *nepm, uchar *kd, int nkd); data/drawterm-20170818/libsec/tlshand.c:453:38: [3] (random) random: 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. memmove(c->crandom, m.u.clientHello.random, RandomSize); data/drawterm-20170818/libsec/tlshand.c:476:91: [3] (random) srandom: 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. c->sec = tlsSecInits(c->clientVersion, csid->data, csid->len, c->crandom, sid, &nsid, c->srandom); data/drawterm-20170818/libsec/tlshand.c:491:26: [3] (random) random: 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. memmove(m.u.serverHello.random, c->srandom, RandomSize); data/drawterm-20170818/libsec/tlshand.c:491:37: [3] (random) srandom: 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. memmove(m.u.serverHello.random, c->srandom, RandomSize); data/drawterm-20170818/libsec/tlshand.c:611:26: [3] (random) random: 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. memmove(m.u.clientHello.random, c->crandom, RandomSize); data/drawterm-20170818/libsec/tlshand.c:630:13: [3] (random) srandom: 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. memmove(c->srandom, m.u.serverHello.random, RandomSize); data/drawterm-20170818/libsec/tlshand.c:630:38: [3] (random) random: 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. memmove(c->srandom, m.u.serverHello.random, RandomSize); data/drawterm-20170818/libsec/tlshand.c:683:57: [3] (random) srandom: 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. if(tlsSecSecretc(c->sec, c->sid->data, c->sid->len, c->srandom, data/drawterm-20170818/libsec/tlshand.c:810:31: [3] (random) random: 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. memmove(p, m->u.clientHello.random, RandomSize); data/drawterm-20170818/libsec/tlshand.c:840:31: [3] (random) random: 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. memmove(p, m->u.serverHello.random, RandomSize); data/drawterm-20170818/libsec/tlshand.c:1005:27: [3] (random) random: 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. memset(m->u.clientHello.random, 0, RandomSize - nrandom); data/drawterm-20170818/libsec/tlshand.c:1006:29: [3] (random) random: 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. memmove(&m->u.clientHello.random[RandomSize - nrandom], p, nrandom); data/drawterm-20170818/libsec/tlshand.c:1037:28: [3] (random) random: 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. memmove(m->u.clientHello.random, p, RandomSize); data/drawterm-20170818/libsec/tlshand.c:1076:28: [3] (random) random: 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. memmove(m->u.serverHello.random, p, RandomSize); data/drawterm-20170818/libsec/tlshand.c:1288:50: [3] (random) random: 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. bs = seprint(bs, be, "%.2x", m->u.clientHello.random[i]); data/drawterm-20170818/libsec/tlshand.c:1299:50: [3] (random) random: 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. bs = seprint(bs, be, "%.2x", m->u.serverHello.random[i]); data/drawterm-20170818/libsec/tlshand.c:1718:96: [3] (random) srandom: 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. tlsSecInits(int cvers, uchar *csid, int ncsid, uchar *crandom, uchar *ssid, int *nssid, uchar *srandom) data/drawterm-20170818/libsec/tlshand.c:1727:13: [3] (random) srandom: 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. put32(sec->srandom, time(0)); data/drawterm-20170818/libsec/tlshand.c:1729:10: [3] (random) srandom: 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. memmove(srandom, sec->srandom, RandomSize); data/drawterm-20170818/libsec/tlshand.c:1729:24: [3] (random) srandom: 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. memmove(srandom, sec->srandom, RandomSize); data/drawterm-20170818/libsec/tlshand.c:1774:57: [3] (random) srandom: 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. tlsSecSecretc(TlsSec *sec, uchar *sid, int nsid, uchar *srandom, uchar *cert, int ncert, int vers, uchar **epm, int *nepm, uchar *kd, int nkd) data/drawterm-20170818/libsec/tlshand.c:1783:15: [3] (random) srandom: 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. memmove(sec->srandom, srandom, RandomSize); data/drawterm-20170818/libsec/tlshand.c:1783:24: [3] (random) srandom: 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. memmove(sec->srandom, srandom, RandomSize); data/drawterm-20170818/libsec/tlshand.c:1876:9: [3] (random) srandom: 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. sec->srandom, RandomSize, sec->crandom, RandomSize); data/drawterm-20170818/libsec/tlshand.c:1886:35: [3] (random) srandom: 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. sec->crandom, RandomSize, sec->srandom, RandomSize); data/drawterm-20170818/posix-factotum.c:15:8: [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. #undef getenv data/drawterm-20170818/posix-factotum.c:43: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/drawterm-20170818/posix-factotum.c:66: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/drawterm-20170818/win32-factotum.c:9:8: [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. #undef getenv data/drawterm-20170818/win32-factotum.c:14: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. return getenv("USER"); data/drawterm-20170818/cpu-bl.c:91: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("/mnt/factotum/ctl", OREAD)) < 0){ data/drawterm-20170818/cpu-bl.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 dat[MaxStr], buf[MaxStr], cmd[MaxStr], *err, *secstoreserver, *p, *s; data/drawterm-20170818/cpu-bl.c:106: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/draw", OREAD); data/drawterm-20170818/cpu-bl.c:238: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 bug[256]; data/drawterm-20170818/cpu-bl.c:244: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[MaxStr]; data/drawterm-20170818/cpu-bl.c:245: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/drawterm-20170818/cpu-bl.c:246:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char msg[MaxStr]; data/drawterm-20170818/cpu-bl.c:327: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 chall[32]; data/drawterm-20170818/cpu-bl.c:328: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 resp[32]; data/drawterm-20170818/cpu-bl.c:372: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 fromclientsecret[21]; data/drawterm-20170818/cpu-bl.c:373: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 fromserversecret[21]; data/drawterm-20170818/cpu-bl.c:468: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/cons", ORDWR); data/drawterm-20170818/cpu-bl.c:515: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/drawterm-20170818/cpu-bl.c:517: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("/mnt/factotum/ctl", ORDWR); data/drawterm-20170818/cpu-bl.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 buf[1024], buf2[1024], cchal[CHALLEN], *bbuf, *p, *dom, *u; data/drawterm-20170818/cpu-bl.c:552: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 tbuf[TICKETLEN+TICKETLEN+AUTHENTLEN], trbuf[TICKREQLEN]; data/drawterm-20170818/cpu-bl.c:553: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 authkey[DESKEYLEN]; data/drawterm-20170818/cpu-bl.c:560: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((afd = open("/mnt/factotum/ctl", ORDWR)) >= 0) data/drawterm-20170818/cpu-bl.c:675: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/drawterm-20170818/cpu.c:92: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("/mnt/factotum/ctl", OREAD)) < 0){ data/drawterm-20170818/cpu.c:103:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char dat[MaxStr], buf[MaxStr], cmd[MaxStr], *err, *secstoreserver, *p, *s; data/drawterm-20170818/cpu.c:107: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/draw", OREAD); data/drawterm-20170818/cpu.c:239: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 bug[256]; data/drawterm-20170818/cpu.c:245: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[MaxStr]; data/drawterm-20170818/cpu.c:246:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char err[ERRMAX]; data/drawterm-20170818/cpu.c:247: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 msg[MaxStr]; data/drawterm-20170818/cpu.c:328: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 chall[32]; data/drawterm-20170818/cpu.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 resp[32]; data/drawterm-20170818/cpu.c:373: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 fromclientsecret[21]; data/drawterm-20170818/cpu.c:374: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 fromserversecret[21]; data/drawterm-20170818/cpu.c:469: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/cons", ORDWR); data/drawterm-20170818/cpu.c:516: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/drawterm-20170818/cpu.c:518: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("/mnt/factotum/ctl", ORDWR); data/drawterm-20170818/cpu.c:551: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], buf2[1024], cchal[CHALLEN], *bbuf, *p, *dom, *u; data/drawterm-20170818/cpu.c:553: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 tbuf[TICKETLEN+TICKETLEN+AUTHENTLEN], trbuf[TICKREQLEN]; data/drawterm-20170818/cpu.c:554: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 authkey[DESKEYLEN]; data/drawterm-20170818/cpu.c:561: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((afd = open("/mnt/factotum/ctl", ORDWR)) >= 0) data/drawterm-20170818/cpu.c:692: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/drawterm-20170818/drawterm.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 secstorebuf[65536]; data/drawterm-20170818/exportfs/exportfs.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 buf[ERRMAX], ebuf[ERRMAX]; data/drawterm-20170818/exportfs/exportfs.c:51: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, "this is buf"); data/drawterm-20170818/exportfs/exportfs.c:52: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(ebuf, "this is ebuf"); data/drawterm-20170818/exportfs/exportfs.c:151: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/drawterm-20170818/exportfs/exportfs.c:362: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, *s, *path, *seg[256]; data/drawterm-20170818/exportfs/exportfs.c:492: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/drawterm-20170818/exportfs/exportfs.h:103: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 psmap[Npsmpt]; data/drawterm-20170818/exportfs/exportsrv.c:167: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], *e; data/drawterm-20170818/exportfs/exportsrv.c:249: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], *path; data/drawterm-20170818/exportfs/exportsrv.c:303: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], *path; data/drawterm-20170818/exportfs/exportsrv.c:346: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], *path; data/drawterm-20170818/exportfs/exportsrv.c:380: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], *path; data/drawterm-20170818/exportfs/exportsrv.c:531: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], *path; data/drawterm-20170818/exportfs/exportsrv.c:557: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). f->fid = open(path, work->mode); data/drawterm-20170818/exportfs/exportsrv.c:587: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 *data, err[ERRMAX]; data/drawterm-20170818/exportfs/exportsrv.c:626: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/drawterm-20170818/gui-osx/screen.c:613: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 snarf[3*SnarfSize+1]; data/drawterm-20170818/gui-win32/screen.c:657: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(p, buf, n); data/drawterm-20170818/gui-x11/x11.c:684: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]; data/drawterm-20170818/gui-x11/x11.c:705: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 *argv[2]; data/drawterm-20170818/gui-x11/x11.c:987: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[30]; data/drawterm-20170818/gui-x11/x11.c:1392: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/drawterm-20170818/gui-x11/x11.c:1395: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). if(p && atoi(p) == 1) data/drawterm-20170818/gui-x11/x11.c:1429: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[SnarfSize]; data/drawterm-20170818/include/auth.h:40: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 ibuf[AuthRpcMax]; data/drawterm-20170818/include/auth.h:41: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[AuthRpcMax]; data/drawterm-20170818/include/auth.h:58:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char chal[MAXCHLEN]; data/drawterm-20170818/include/auth.h:66: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 userbuf[AMAXNAMELEN]; /* temp space if needed */ data/drawterm-20170818/include/auth.h:73: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 resp[MD5LEN]; data/drawterm-20170818/include/auth.h:78:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char LMresp[24]; /* Lan Manager response */ data/drawterm-20170818/include/auth.h:79: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 NTresp[24]; /* NT response */ data/drawterm-20170818/include/authsrv.h:63:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char authid[ANAMELEN]; /* server's encryption id */ data/drawterm-20170818/include/authsrv.h:64:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char authdom[DOMLEN]; /* server's authentication domain */ data/drawterm-20170818/include/authsrv.h: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 chal[CHALLEN]; /* challenge from server */ data/drawterm-20170818/include/authsrv.h:66: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 hostid[ANAMELEN]; /* host's encryption id */ data/drawterm-20170818/include/authsrv.h:67: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[ANAMELEN]; /* uid of requesting user on host */ data/drawterm-20170818/include/authsrv.h: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 chal[CHALLEN]; /* server challenge */ data/drawterm-20170818/include/authsrv.h:75: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 cuid[ANAMELEN]; /* uid on client */ data/drawterm-20170818/include/authsrv.h:76: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 suid[ANAMELEN]; /* uid on server */ data/drawterm-20170818/include/authsrv.h:77: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 key[DESKEYLEN]; /* nonce DES key */ data/drawterm-20170818/include/authsrv.h:84: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 chal[CHALLEN]; data/drawterm-20170818/include/authsrv.h:92: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 old[ANAMELEN]; data/drawterm-20170818/include/authsrv.h:93: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 new[ANAMELEN]; data/drawterm-20170818/include/authsrv.h:95: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 secret[SECRETLEN]; /* new secret */ data/drawterm-20170818/include/authsrv.h: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 uid[ANAMELEN]; data/drawterm-20170818/include/authsrv.h:103:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char resp[OMD5LEN]; data/drawterm-20170818/include/authsrv.h:108: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[ANAMELEN]; data/drawterm-20170818/include/authsrv.h: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 LMresp[24]; /* Lan Manager response */ data/drawterm-20170818/include/authsrv.h:110: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 NTresp[24]; /* NT response */ data/drawterm-20170818/include/authsrv.h: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 machkey[DESKEYLEN]; data/drawterm-20170818/include/authsrv.h:144: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 authkey[DESKEYLEN]; data/drawterm-20170818/include/authsrv.h: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 config[CONFIGLEN]; data/drawterm-20170818/include/authsrv.h:148: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 authid[ANAMELEN]; data/drawterm-20170818/include/authsrv.h:150: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 authdom[DOMLEN]; data/drawterm-20170818/include/draw.h:189:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char oldlabel[64]; data/drawterm-20170818/include/fcall.h:26: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/drawterm-20170818/include/libsec.h:229: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/drawterm-20170818/include/libsec.h: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 dir[40]; // connection directory data/drawterm-20170818/include/u.h:17: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/drawterm-20170818/include/user.h:11: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 sysopen data/drawterm-20170818/include/user.h:39: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). extern int open(char*, int); data/drawterm-20170818/kern/chan.c:149: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(s+ns, "..."); data/drawterm-20170818/kern/chan.c:1049: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 *createerr, tmperrbuf[ERRMAX]; data/drawterm-20170818/kern/chan.c:1135: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(tmperrbuf, "create without DMDIR"); data/drawterm-20170818/kern/chan.c:1163: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(tmperrbuf, "not a directory"); data/drawterm-20170818/kern/chan.c:1229:25: [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). c = devtab[c->type]->open(c, omode&~OCEXEC); data/drawterm-20170818/kern/chan.c:1392: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 isfrog[256]={ data/drawterm-20170818/kern/dat.h:221: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). Chan* (*open)(Chan*, int); data/drawterm-20170818/kern/dat.h:236: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[KNAMELEN]; data/drawterm-20170818/kern/dat.h:309: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 msg[ERRMAX]; data/drawterm-20170818/kern/dat.h:410: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 user[KNAMELEN]; data/drawterm-20170818/kern/dat.h:413: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 errbuf0[ERRMAX]; data/drawterm-20170818/kern/dat.h:414: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 errbuf1[ERRMAX]; data/drawterm-20170818/kern/dat.h:415: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 genbuf[128]; /* buffer used e.g. for last name element from namec */ data/drawterm-20170818/kern/dat.h:416: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[KNAMELEN]; data/drawterm-20170818/kern/dat.h:426: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 oproc[1024]; /* reserved for os */ data/drawterm-20170818/kern/dev.c:313: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 slop[100]; data/drawterm-20170818/kern/devaudio-sun.c:39:2: [2] (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 string. strcat(cfn, "ctl"); data/drawterm-20170818/kern/devaudio-sun.c:66: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((afd = open(afn, O_WRONLY)) < 0) data/drawterm-20170818/kern/devaudio-sun.c:68: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(cfd < 0 && (cfd = open(cfn, O_RDWR)) < 0) data/drawterm-20170818/kern/devaudio-sun.c:177: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(cfd < 0 && (cfd = open(cfn, O_RDWR)) < 0) { data/drawterm-20170818/kern/devaudio-sun.c:210: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(cfd < 0 && (cfd = open(cfn, O_RDWR)) < 0) { data/drawterm-20170818/kern/devaudio-unix.c:38: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((afd = open("/dev/dsp", OWRITE)) < 0) data/drawterm-20170818/kern/devaudio-unix.c:40: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((cfd = open("/dev/mixer", ORDWR)) < 0) data/drawterm-20170818/kern/devaudio.c:164: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]; data/drawterm-20170818/kern/devcons.c: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 line[1024]; /* current input line */ data/drawterm-20170818/kern/devcons.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 istage[1024]; data/drawterm-20170818/kern/devcons.c:162: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[PRINTSIZE]; data/drawterm-20170818/kern/devcons.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[PRINTSIZE]; data/drawterm-20170818/kern/devcons.c:189: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, "panic: "); data/drawterm-20170818/kern/devcons.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[2*PRINTSIZE]; data/drawterm-20170818/kern/devcons.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 ebuf[128]; data/drawterm-20170818/kern/devcons.c:266: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 ebuf[128]; data/drawterm-20170818/kern/devcons.c:402: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/drawterm-20170818/kern/devcons.c:512: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 secstorebuf[65536]; data/drawterm-20170818/kern/devcons.c:519: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/drawterm-20170818/kern/devcons.c:661: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[128]; /* must be >= 6*NUMSIZE */ data/drawterm-20170818/kern/devcons.c:820: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/drawterm-20170818/kern/devcons.c:1068: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[7*NUMSIZE]; data/drawterm-20170818/kern/devcons.c:1088: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 b[13]; data/drawterm-20170818/kern/devcons.c:1179: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[PRINTSIZE]; data/drawterm-20170818/kern/devdraw.c:228:5: [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(up->genbuf, "??"); data/drawterm-20170818/kern/devdraw.c:1096: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[16]; data/drawterm-20170818/kern/devdraw.c:1206: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], *fields[4], *q; data/drawterm-20170818/kern/devdraw.c:1305: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/drawterm-20170818/kern/devfs-posix.c:38: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 nextname[NAME_MAX]; data/drawterm-20170818/kern/devfs-posix.c:117:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[MAXPATH]; data/drawterm-20170818/kern/devfs-posix.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 path[MAXPATH]; data/drawterm-20170818/kern/devfs-posix.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 path[MAXPATH]; data/drawterm-20170818/kern/devfs-posix.c:244: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). uif->fd = open(path, m, 0666); data/drawterm-20170818/kern/devfs-posix.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 path[MAXPATH]; data/drawterm-20170818/kern/devfs-posix.c:277: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, 0); data/drawterm-20170818/kern/devfs-posix.c:289: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_WRONLY|O_CREAT|O_TRUNC, 0666); data/drawterm-20170818/kern/devfs-posix.c:293: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(path, m); data/drawterm-20170818/kern/devfs-posix.c:399:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[MAXPATH]; data/drawterm-20170818/kern/devfs-posix.c:415: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 old[MAXPATH], new[MAXPATH]; data/drawterm-20170818/kern/devfs-posix.c:416: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 strs[MAXPATH*3], *p; data/drawterm-20170818/kern/devfs-posix.c:543: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 de[NAME_MAX]; data/drawterm-20170818/kern/devfs-posix.c:545:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[MAXPATH], dirpath[MAXPATH]; data/drawterm-20170818/kern/devfs-win32.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 nextname[NAME_MAX]; data/drawterm-20170818/kern/devfs-win32.c:134:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[MAXPATH]; data/drawterm-20170818/kern/devfs-win32.c:194:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[MAXPATH]; data/drawterm-20170818/kern/devfs-win32.c:220:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[MAXPATH]; data/drawterm-20170818/kern/devfs-win32.c:261: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). uif->fd = open(path, m|_O_BINARY, 0666); data/drawterm-20170818/kern/devfs-win32.c:277:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[MAXPATH]; data/drawterm-20170818/kern/devfs-win32.c:294: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, 0); data/drawterm-20170818/kern/devfs-win32.c:306: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_WRONLY|_O_BINARY|_O_CREAT|_O_TRUNC, 0666); data/drawterm-20170818/kern/devfs-win32.c:310: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(path, m|_O_BINARY); data/drawterm-20170818/kern/devfs-win32.c:416:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[MAXPATH]; data/drawterm-20170818/kern/devfs-win32.c:432: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 old[MAXPATH], new[MAXPATH]; data/drawterm-20170818/kern/devfs-win32.c:433: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 strs[MAXPATH*3], *p; data/drawterm-20170818/kern/devfs-win32.c:555: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 de[NAME_MAX]; data/drawterm-20170818/kern/devfs-win32.c:557:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[MAXPATH], dirpath[MAXPATH]; data/drawterm-20170818/kern/devfs-win32.c:667:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[MAX_PATH]; data/drawterm-20170818/kern/devip-posix.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 buf[1024]; data/drawterm-20170818/kern/devip-posix.c:95:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&((struct sockaddr_in6*)&ss)->sin6_addr.s6_addr, raddr, sizeof(struct in6_addr)); data/drawterm-20170818/kern/devip-posix.c:119:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(laddr, &((struct sockaddr_in6*)&ss)->sin6_addr.s6_addr, sizeof(struct in6_addr)); data/drawterm-20170818/kern/devip-posix.c:152:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(raddr, &((struct sockaddr_in6*)&ss)->sin6_addr.s6_addr, sizeof(struct in6_addr)); data/drawterm-20170818/kern/devip-posix.c:213: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/drawterm-20170818/kern/devip-posix.c:234: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[INET6_ADDRSTRLEN]; data/drawterm-20170818/kern/devip-win32.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 buf[1024]; data/drawterm-20170818/kern/devip-win32.c:99:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&((struct sockaddr_in6*)&ss)->sin6_addr.s6_addr, raddr, sizeof(struct in6_addr)); data/drawterm-20170818/kern/devip-win32.c:123:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(laddr, &((struct sockaddr_in6*)&ss)->sin6_addr.s6_addr, sizeof(struct in6_addr)); data/drawterm-20170818/kern/devip-win32.c:156:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(raddr, &((struct sockaddr_in6*)&ss)->sin6_addr.s6_addr, sizeof(struct in6_addr)); data/drawterm-20170818/kern/devip-win32.c:217: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/drawterm-20170818/kern/devip-win32.c:238: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/drawterm-20170818/kern/devip.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 owner[KNAMELEN]; data/drawterm-20170818/kern/devip.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 cerr[KNAMELEN]; data/drawterm-20170818/kern/devip.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 name[KNAMELEN]; data/drawterm-20170818/kern/devip.c:320: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(cc->owner, "network"); data/drawterm-20170818/kern/devip.c:339: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], *p; data/drawterm-20170818/kern/devip.c:419: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). c->lport = atoi(p); data/drawterm-20170818/kern/devip.c:436: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). c->rport = atoi(p); data/drawterm-20170818/kern/devip.c:451: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 *p, *fields[3], buf[128]; data/drawterm-20170818/kern/devip.c:480:16: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). c->lport = atoi(fields[2]); data/drawterm-20170818/kern/devip.c:508:16: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). c->lport = atoi(fields[1]); data/drawterm-20170818/kern/devip.c:706: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[10], *p; data/drawterm-20170818/kern/devip.c:714: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). return atoi(buf); data/drawterm-20170818/kern/devip.c:737:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *f[4]; data/drawterm-20170818/kern/devmnt.c:106: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/drawterm-20170818/kern/devmouse.c:60: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(mouse.open){ data/drawterm-20170818/kern/devmouse.c:93: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*12+1]; data/drawterm-20170818/kern/devmouse.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[64]; data/drawterm-20170818/kern/devssl.c:80: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 *dsname[Maxdstate]; data/drawterm-20170818/kern/devssl.c:134: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[16], *p, *nm; data/drawterm-20170818/kern/devssl.c:667: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/drawterm-20170818/kern/devssl.c:1057: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 *p, *np, *e, buf[128]; data/drawterm-20170818/kern/devtls.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 err[ERRMAX]; /* error message to return to handshake requests */ data/drawterm-20170818/kern/devtls.c:970: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 msg[ERRMAX]; data/drawterm-20170818/kern/devtls.c:2160: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[65+32]; data/drawterm-20170818/kern/exportfs.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 part[MAXRPC]; data/drawterm-20170818/kern/exportfs.c:54:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXRPC]; data/drawterm-20170818/kern/exportfs.c:85: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 *(*fcalls[Tmax])(Export*, Fcall*); data/drawterm-20170818/kern/exportfs.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 buf[MAXMSG]; data/drawterm-20170818/kern/exportfs.c:638:24: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). c = (*devtab[c->type].open)(c, rpc->mode); data/drawterm-20170818/kern/netif.h:38: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 owner[KNAMELEN]; data/drawterm-20170818/kern/netif.h:70:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[KNAMELEN]; /* for top level directory */ data/drawterm-20170818/kern/pgrp.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 buf[ERRMAX]; data/drawterm-20170818/kern/posix.c:166: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/drawterm-20170818/kern/posix.c:173:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if((randfd = open("/dev/urandom", OREAD)) < 0) data/drawterm-20170818/kern/posix.c:174:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if((randfd = open("/dev/random", OREAD)) < 0) data/drawterm-20170818/kern/procinit.c:38: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(p->text, "drawterm"); data/drawterm-20170818/kern/qio.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 err[ERRMAX]; data/drawterm-20170818/kern/screen.h:21:6: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int open; data/drawterm-20170818/kern/syscall.c:335:27: [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). nc = (*devtab[nc->type].open)((Chan*)nc, OREAD); data/drawterm-20170818/kern/syscall.c:423: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[DIRLEN]; data/drawterm-20170818/kern/syscall.c:519: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[DIRLEN]; data/drawterm-20170818/kern/syscall.c:530: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[DIRLEN]; data/drawterm-20170818/kern/syscall.c:542: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[DIRLEN]; data/drawterm-20170818/kern/syscall.c:551: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[DIRLEN]; data/drawterm-20170818/kern/syscall.c:561: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[DIRLEN*50]; data/drawterm-20170818/kern/syscall.c:590: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 *p, name[3*NAMELEN+5], data[3*NAMELEN+10]; data/drawterm-20170818/kern/syscall.c:642: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 *p, net[128], clone[NAMELEN+12]; data/drawterm-20170818/kern/syscall.c:696: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 reply[4*NAMELEN]; data/drawterm-20170818/kern/syscall.c:717: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 reply[4*NAMELEN]; data/drawterm-20170818/kern/syscall.c:755: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*NAMELEN]; data/drawterm-20170818/kern/syscall.c:756: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 buf2[3*NAMELEN]; data/drawterm-20170818/kern/syscall.c:757: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 netdir[2*NAMELEN]; data/drawterm-20170818/kern/syscall.c:758: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 naddr[3*NAMELEN]; data/drawterm-20170818/kern/syscall.c:811: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*NAMELEN]; data/drawterm-20170818/kern/sysfile.c:8: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/drawterm-20170818/kern/sysfile.c:224: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). c[0] = d->open(c[0], ORDWR); data/drawterm-20170818/kern/sysfile.c:225: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). c[1] = d->open(c[1], ORDWR); data/drawterm-20170818/kern/sysfile.c:354:36: [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). c->umc = devtab[c->umc->type]->open(c->umc, OREAD); data/drawterm-20170818/kern/sysfile.c:563: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[64]; data/drawterm-20170818/kern/sysfile.c:1147: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/drawterm-20170818/kern/sysfile.c:1172: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/drawterm-20170818/kern/sysproc.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 buf[ERRMAX]; data/drawterm-20170818/kern/term.c:184: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/drawterm-20170818/libauth/attr.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 *b, buf[1024], *ebuf; data/drawterm-20170818/libauth/attr.c:130: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 *p, *t, *tok[256]; data/drawterm-20170818/libauth/auth_challenge.c:27:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if((c->afd = open("/mnt/factotum/rpc", ORDWR)) < 0){ data/drawterm-20170818/libauth/auth_getuserpasswd.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 *f[3], *p, *params; data/drawterm-20170818/libauth/auth_getuserpasswd.c:38: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("/mnt/factotum/rpc", ORDWR); data/drawterm-20170818/libauth/auth_proxy.c:125: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 oerr[ERRMAX]; data/drawterm-20170818/libauth/auth_proxy.c:155:8: [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(atoi(rpc->arg) > AuthRpcMax) data/drawterm-20170818/libauth/auth_proxy.c:157:25: [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). m = read(fd, buf+n, atoi(rpc->arg)-n); data/drawterm-20170818/libauth/auth_proxy.c:194: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). afd = open("/mnt/factotum/rpc", ORDWR); data/drawterm-20170818/libauth/auth_respond.c:35: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((afd = open("/mnt/factotum/rpc", ORDWR)) < 0) data/drawterm-20170818/libauth/auth_rpc.c:64:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *f[4]; data/drawterm-20170818/libauth/auth_userpasswd.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 key[DESKEYLEN], resp[16]; data/drawterm-20170818/libauth/auth_userpasswd.c:42:15: [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). netresp(key, atol(ch->chal), resp); data/drawterm-20170818/libauth/httpauth.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 key[DESKEYLEN]; data/drawterm-20170818/libauth/httpauth.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[512]; data/drawterm-20170818/libauthsrv/_asrdresp.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 error[64]; data/drawterm-20170818/libauthsrv/_asrdresp.c:40: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(error); data/drawterm-20170818/libauthsrv/authdial.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 server[Ndbvlen]; data/drawterm-20170818/libauthsrv/readnvram.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 line[10]; data/drawterm-20170818/libauthsrv/readnvram.c:48: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). fdin = open("/dev/cons", OREAD); data/drawterm-20170818/libauthsrv/readnvram.c:51: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). fdout = open("/dev/cons", OWRITE); data/drawterm-20170818/libauthsrv/readnvram.c:59: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). ctl = open("/dev/consctl", OWRITE); data/drawterm-20170818/libauthsrv/readnvram.c:123:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024], in[128], *cputype, *nvrfile, *nvrlen, *nvroff, *v[2]; data/drawterm-20170818/libauthsrv/readnvram.c:145: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(v[0], ORDWR); data/drawterm-20170818/libauthsrv/readnvram.c:151: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). safelen = atoi(nvrlen); data/drawterm-20170818/libauthsrv/readnvram.c:157: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). safeoff = atoi(nvroff); data/drawterm-20170818/libauthsrv/readnvram.c:176: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(nvtab[i].file, ORDWR)) < 0) data/drawterm-20170818/libauthsrv/readnvram.c:266: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[8]; data/drawterm-20170818/libauthsrv/readnvram.c:267: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 ext[3]; data/drawterm-20170818/libauthsrv/readnvram.c:316: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[8]; data/drawterm-20170818/libauthsrv/readnvram.c:317: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 ext[3]; data/drawterm-20170818/libc/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[4]; data/drawterm-20170818/libc/convD2M.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 *sv[4]; data/drawterm-20170818/libc/convM2D.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 *sv[4]; data/drawterm-20170818/libc/dial.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[Maxstring]; data/drawterm-20170818/libc/dial.c:38: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], alterr[ERRMAX]; data/drawterm-20170818/libc/dial.c:76: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 *p, buf[Maxstring], clone[Maxpath], err[ERRMAX], besterr[ERRMAX]; data/drawterm-20170818/libc/dial.c:82: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(buf, ORDWR); data/drawterm-20170818/libc/dial.c:105: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(err, "cs gave empty translation list"); data/drawterm-20170818/libc/dial.c:133: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[Maxpath], data[Maxpath], *p; data/drawterm-20170818/libc/dial.c:135: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). cfd = open(clone, ORDWR); data/drawterm-20170818/libc/dial.c:166: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(data, ORDWR); data/drawterm-20170818/libc/dirmodefmt.c:26: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/drawterm-20170818/libc/dofmt.c:218:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char x[1]; data/drawterm-20170818/libc/dofmt.c:312: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[70], *p, *conv; data/drawterm-20170818/libc/dofmt.c:531: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/drawterm-20170818/libc/encodefmt.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 obuf[64]; // rsc optimization data/drawterm-20170818/libc/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/drawterm-20170818/libc/fcallfmt.c:170: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/drawterm-20170818/libc/fcallfmt.c:179: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/drawterm-20170818/libc/fltfmt.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 s1[NSIGNIF+10]; data/drawterm-20170818/libc/fltfmt.c:130: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(s2, "NaN"); data/drawterm-20170818/libc/fltfmt.c:134: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(s2, "+Inf"); data/drawterm-20170818/libc/fltfmt.c:138: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(s2, "-Inf"); data/drawterm-20170818/libc/fltfmt.c:360: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[341]; /* precision+exponent+sign+'.'+null */ data/drawterm-20170818/libc/getpid.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 b[20]; data/drawterm-20170818/libc/getpid.c:11:6: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f = open("#c/pid", 0); data/drawterm-20170818/libc/getpid.c:16: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). return atol(b); data/drawterm-20170818/libc/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/drawterm-20170818/libc/nsec.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 b[12+1]; data/drawterm-20170818/libc/nsec.c:38: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("/dev/bintime", OREAD|OCEXEC); data/drawterm-20170818/libc/nsec.c:41: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("/dev/nsec", OREAD|OCEXEC); data/drawterm-20170818/libc/pushssl.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 buf[8]; data/drawterm-20170818/libc/pushssl.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 dname[64]; data/drawterm-20170818/libc/pushssl.c:17: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). ctl = open("#D/ssl/clone", ORDWR); data/drawterm-20170818/libc/pushssl.c:25: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). data = open(dname, ORDWR); data/drawterm-20170818/libc/pushtls.c:45: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[8]; data/drawterm-20170818/libc/pushtls.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 dname[64]; data/drawterm-20170818/libc/pushtls.c:53: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). ctl = open("#a/tls/clone", ORDWR); data/drawterm-20170818/libc/pushtls.c:65: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). data = open(dname, ORDWR); data/drawterm-20170818/libc/pushtls.c:71: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). hand = open(dname, ORDWR); data/drawterm-20170818/libc/rune.c:123:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char str[10]; data/drawterm-20170818/libc/strtod.c:78:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *s, a[Ndig]; data/drawterm-20170818/libc/sysfatal.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[1024]; data/drawterm-20170818/libc/time.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 b[20]; data/drawterm-20170818/libc/time.c:23: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("/dev/time", OREAD|OCEXEC); data/drawterm-20170818/libc/time.c:34:6: [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(b); data/drawterm-20170818/libc/truerand.c:11: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("/dev/random", OREAD|OCEXEC); data/drawterm-20170818/libc/vfprint.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[256]; data/drawterm-20170818/libdraw/alloc.c:101: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[12*12+1]; data/drawterm-20170818/libdraw/alloc.c:158: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). i->repl = atoi(buf+3*12); data/drawterm-20170818/libdraw/alloc.c:159: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). i->r.min.x = atoi(buf+4*12); data/drawterm-20170818/libdraw/alloc.c:160: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). i->r.min.y = atoi(buf+5*12); data/drawterm-20170818/libdraw/alloc.c:161: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). i->r.max.x = atoi(buf+6*12); data/drawterm-20170818/libdraw/alloc.c:162: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). i->r.max.y = atoi(buf+7*12); data/drawterm-20170818/libdraw/alloc.c:163:19: [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->clipr.min.x = atoi(buf+8*12); data/drawterm-20170818/libdraw/alloc.c:164:19: [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->clipr.min.y = atoi(buf+9*12); data/drawterm-20170818/libdraw/alloc.c:165:19: [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->clipr.max.x = atoi(buf+10*12); data/drawterm-20170818/libdraw/alloc.c:166:19: [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->clipr.max.y = atoi(buf+11*12); data/drawterm-20170818/libip/eipfmt.c:26: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[5*8]; data/drawterm-20170818/libip/parseip.c:129: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(from+1); data/drawterm-20170818/libip/parseip.c:182:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(mask, defmask(addr), IPv4addrlen); data/drawterm-20170818/libmemdraw/arctest.c:27: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(argv[1]); data/drawterm-20170818/libmemdraw/arctest.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[1024]; data/drawterm-20170818/libmemdraw/cread.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 hdr[5*12+1]; data/drawterm-20170818/libmemdraw/cread.c:51: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). r.min.x=atoi(hdr+1*12); data/drawterm-20170818/libmemdraw/cread.c:52: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). r.min.y=atoi(hdr+2*12); data/drawterm-20170818/libmemdraw/cread.c:53: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). r.max.x=atoi(hdr+3*12); data/drawterm-20170818/libmemdraw/cread.c:54: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). r.max.y=atoi(hdr+4*12); data/drawterm-20170818/libmemdraw/cread.c:77: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). maxy = atoi(hdr+0*12); data/drawterm-20170818/libmemdraw/cread.c:78:8: [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). nb = atoi(hdr+1*12); data/drawterm-20170818/libmemdraw/defont.c:29: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). ld = atoi(p+0*12); data/drawterm-20170818/libmemdraw/defont.c:30: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). r.min.x = atoi(p+1*12); data/drawterm-20170818/libmemdraw/defont.c:31: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). r.min.y = atoi(p+2*12); data/drawterm-20170818/libmemdraw/defont.c:32: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). r.max.x = atoi(p+3*12); data/drawterm-20170818/libmemdraw/defont.c:33: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). r.max.y = atoi(p+4*12); data/drawterm-20170818/libmemdraw/defont.c:53: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(hdr); data/drawterm-20170818/libmemdraw/defont.c:61:38: [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). f = allocmemsubfont("*default*", n, atoi(hdr+12), atoi(hdr+24), fc, i); data/drawterm-20170818/libmemdraw/defont.c:61:52: [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). f = allocmemsubfont("*default*", n, atoi(hdr+12), atoi(hdr+24), fc, i); data/drawterm-20170818/libmemdraw/drawtest.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 buf[1024]; data/drawterm-20170818/libmemdraw/drawtest.c:80: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). Xrange = atoi(ARGF()); data/drawterm-20170818/libmemdraw/drawtest.c:83: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). Yrange = atoi(ARGF()); data/drawterm-20170818/libmemdraw/drawtest.c:86: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). niters = atoi(ARGF()); data/drawterm-20170818/libmemdraw/drawtest.c:89: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). seed = atoi(ARGF()); data/drawterm-20170818/libmemdraw/openmemsubfont.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 hdr[3*12+4+1]; data/drawterm-20170818/libmemdraw/openmemsubfont.c:16: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/drawterm-20170818/libmemdraw/openmemsubfont.c:27: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(hdr); data/drawterm-20170818/libmemdraw/openmemsubfont.c:39:32: [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). sf = allocmemsubfont(name, n, atoi(hdr+12), atoi(hdr+24), fc, i); data/drawterm-20170818/libmemdraw/openmemsubfont.c:39:46: [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). sf = allocmemsubfont(name, n, atoi(hdr+12), atoi(hdr+24), fc, i); data/drawterm-20170818/libmemdraw/read.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 hdr[5*12+1]; data/drawterm-20170818/libmemdraw/read.c:62: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). r.min.x = atoi(hdr+1*12); data/drawterm-20170818/libmemdraw/read.c:63: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). r.min.y = atoi(hdr+2*12); data/drawterm-20170818/libmemdraw/read.c:64: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). r.max.x = atoi(hdr+3*12); data/drawterm-20170818/libmemdraw/read.c:65: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). r.max.y = atoi(hdr+4*12); data/drawterm-20170818/libmemdraw/write.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 hdr[11+5*12+1]; data/drawterm-20170818/libmemdraw/write.c:40: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[20]; data/drawterm-20170818/libsec/dsaprimes.c:51:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sj, s, 20); data/drawterm-20170818/libsec/dsaprimes.c:68:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sjk, sj, 20); data/drawterm-20170818/libsec/genrandom.c:29:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(rand, (uchar*)&x, n8); data/drawterm-20170818/libsec/readcert.c:13: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/drawterm-20170818/libsec/thumb.c:54:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *line, *field[50]; data/drawterm-20170818/libsec/thumb.c:75:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(entry->sha1, sum, SHA1dlen); data/drawterm-20170818/libsec/tlshand.c:316: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[8]; data/drawterm-20170818/libsec/tlshand.c:317: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 dname[64]; data/drawterm-20170818/libsec/tlshand.c:323: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). ctl = open("#a/tls/clone", ORDWR); data/drawterm-20170818/libsec/tlshand.c:334: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). hand = open(dname, ORDWR); data/drawterm-20170818/libsec/tlshand.c:342: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). data = open(dname, ORDWR); data/drawterm-20170818/libsec/tlshand.c:359: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(conn->sessionID, tls->sid->data, conn->sessionIDlen); data/drawterm-20170818/libsec/tlshand.c:369: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[8]; data/drawterm-20170818/libsec/tlshand.c:370: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 dname[64]; data/drawterm-20170818/libsec/tlshand.c:376: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). ctl = open("#a/tls/clone", ORDWR); data/drawterm-20170818/libsec/tlshand.c:387: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). hand = open(dname, ORDWR); data/drawterm-20170818/libsec/tlshand.c:393: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). data = open(dname, ORDWR); data/drawterm-20170818/libsec/tlshand.c:407: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(conn->cert, tls->cert->data, conn->certlen); data/drawterm-20170818/libsec/tlshand.c:410: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(conn->sessionID, tls->sid->data, conn->sessionIDlen); data/drawterm-20170818/libsec/tlshand.c:1184:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[8000]; data/drawterm-20170818/libsec/tlshand.c:1338: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 msg[512]; data/drawterm-20170818/libsec/tlshand.c:1489: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[MaxAlgF], *flds[MaxAlgs]; data/drawterm-20170818/libsec/tlshand.c:1497:6: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). j = open("#a/tls/encalgs", OREAD); data/drawterm-20170818/libsec/tlshand.c:1521:6: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). j = open("#a/tls/hashalgs", OREAD); data/drawterm-20170818/libsec/tlshand.c:1581: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((afd = open("/mnt/factotum/rpc", ORDWR)) < 0) data/drawterm-20170818/libsec/x509.c:1668:5: [2] (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 string. strcat(ans, ", "); data/drawterm-20170818/libsec/x509.c:1967: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(&p[pm1+1], b->data, b->len); data/drawterm-20170818/libsec/x509.c:2171: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 utc[50]; data/drawterm-20170818/libsec/x509.c:2228: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 prefix[4]; data/drawterm-20170818/libsec/x509.c:2250:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *f[20], *prefix, *d2 = estrdup(dn); data/drawterm-20170818/libsec/x509.c:2269:24: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. X509gen(RSApriv *priv, char *subj, ulong valid[2], int *certlen) data/drawterm-20170818/main.c:61: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). if(open("/dev/cons", OREAD) != 0) data/drawterm-20170818/main.c:63: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). if(open("/dev/cons", OWRITE) != 1) data/drawterm-20170818/main.c:65: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). if(open("/dev/cons", OWRITE) != 2) data/drawterm-20170818/main.c:75: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/drawterm-20170818/main.c:84: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], *f[50], *p, *ep, *nextp, *pass, *user; data/drawterm-20170818/posix-factotum.c:21: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/drawterm-20170818/readcons.c:47: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/drawterm-20170818/readcons.c:50: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). fdin = open("/dev/cons", OREAD); data/drawterm-20170818/readcons.c:53: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). fdout = open("/dev/cons", OWRITE); data/drawterm-20170818/readcons.c:61: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). ctl = open("/dev/consctl", OWRITE); data/drawterm-20170818/secstore.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 *p, buf[80], *f[3]; data/drawterm-20170818/secstore.c:306: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[Maxmsg]; data/drawterm-20170818/secstore.c:325: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(s, "read error"); data/drawterm-20170818/secstore.c:335: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[Maxmsg+1], *gf; data/drawterm-20170818/secstore.c:352: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). if((len = atoi(s)) < 0){ data/drawterm-20170818/secstore.c:513: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 kc[2*SHA1dlen+1]; data/drawterm-20170818/secstore.c:610: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[Maxmsg+1], bye[10]; data/drawterm-20170818/secstore.c:655: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(bye, "BYE"); data/drawterm-20170818/cpu-bl.c:148: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(cmd, " "); data/drawterm-20170818/cpu-bl.c:174: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(strlen(s) >= sizeof secstorebuf) data/drawterm-20170818/cpu-bl.c:232: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, str, strlen(str)); data/drawterm-20170818/cpu-bl.c:279: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(str); data/drawterm-20170818/cpu-bl.c:291:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd, str, 1); data/drawterm-20170818/cpu-bl.c:311:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(0, p, 1) != 1) data/drawterm-20170818/cpu-bl.c:521:2: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(fd, buf, sizeof buf); data/drawterm-20170818/cpu-bl.c:581: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(write(fd, buf2, strlen(buf2)+1) != strlen(buf2)+1) data/drawterm-20170818/cpu-bl.c:581:40: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(write(fd, buf2, strlen(buf2)+1) != strlen(buf2)+1) data/drawterm-20170818/cpu-bl.c:608: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). memset(pass, 0, strlen(pass)); data/drawterm-20170818/cpu.c:143: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(cmd, " "); data/drawterm-20170818/cpu.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(s) >= sizeof secstorebuf) data/drawterm-20170818/cpu.c:233: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, str, strlen(str)); data/drawterm-20170818/cpu.c:280: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(str); data/drawterm-20170818/cpu.c:292:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd, str, 1); data/drawterm-20170818/cpu.c:312:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(0, p, 1) != 1) data/drawterm-20170818/cpu.c:522:2: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(fd, buf, sizeof buf); data/drawterm-20170818/cpu.c:583: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(write(fd, buf2, strlen(buf2)+1) != strlen(buf2)+1) data/drawterm-20170818/cpu.c:583:40: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(write(fd, buf2, strlen(buf2)+1) != strlen(buf2)+1) data/drawterm-20170818/cpu.c:610: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). memset(pass, 0, strlen(pass)); data/drawterm-20170818/exportfs/exportfs.c:365: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)+2; data/drawterm-20170818/exportfs/exportfs.c:368: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(p->name)+1; data/drawterm-20170818/gui-win32/screen.c:631: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(buf); data/drawterm-20170818/gui-x11/x11.c:832: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). name.nitems = strlen((char*)name.value); data/drawterm-20170818/gui-x11/x11.c:1415: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). if(strncmp(p, buf, strlen(p)) == 0 && buf[strlen(p)]=='.') data/drawterm-20170818/gui-x11/x11.c:1415: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). if(strncmp(p, buf, strlen(p)) == 0 && buf[strlen(p)]=='.') data/drawterm-20170818/gui-x11/x11.c:1497:3: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(100*1000); data/drawterm-20170818/gui-x11/x11.c:1533: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(data) >= SnarfSize) data/drawterm-20170818/gui-x11/x11.c:1581: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). 8, PropModeReplace, (uchar*)clip.buf, strlen(clip.buf)); data/drawterm-20170818/include/u.h:19:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #undef read data/drawterm-20170818/include/user.h:12:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define read sysread data/drawterm-20170818/include/user.h:41:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). extern long read(int, void*, long); data/drawterm-20170818/kern/chan.c:131: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). nt = strlen(t); data/drawterm-20170818/kern/chan.c:139:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(s, t, ns); data/drawterm-20170818/kern/chan.c:171: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)+1; data/drawterm-20170818/kern/chan.c:266: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(s); data/drawterm-20170818/kern/chan.c:305: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(s); data/drawterm-20170818/kern/chan.c:950: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). n->len = strlen(n->s); data/drawterm-20170818/kern/chan.c:1002: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). e->off[e->nelems] = name+strlen(name) - e->name; data/drawterm-20170818/kern/dat.h:224:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). long (*read)(Chan*, void*, long, vlong); data/drawterm-20170818/kern/dev.c:135: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). buf = smalloc(4+strlen(spec)+1); data/drawterm-20170818/kern/dev.c:414:29: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bp->wp += devtab[c->type]->read(c, bp->wp, n, offset); data/drawterm-20170818/kern/devaudio-sun.c:35: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). cfn = (char*)malloc(strlen(afn) + 3 + 1); data/drawterm-20170818/kern/devcons.c:191: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 = vseprint(buf+strlen(buf), buf+sizeof(buf), fmt, arg) - buf; data/drawterm-20170818/kern/devcons.c:536: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). size = strlen(str); data/drawterm-20170818/kern/devcons.c:849:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, a, n); data/drawterm-20170818/kern/devcons.c:963:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, a, n); data/drawterm-20170818/kern/devcons.c:1094:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(b, buf, n); data/drawterm-20170818/kern/devdraw.c:448: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(a) != n) data/drawterm-20170818/kern/devdraw.c:478: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). n = drawlookupname(strlen(d->name), d->name); data/drawterm-20170818/kern/devfs-posix.c:352:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd, va, n); data/drawterm-20170818/kern/devfs-posix.c:495: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(path, "/"); data/drawterm-20170818/kern/devfs-posix.c:498:3: [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(path, "/"); data/drawterm-20170818/kern/devfs-win32.c:369:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd, va, n); data/drawterm-20170818/kern/devfs-win32.c:514: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(path, "/"); data/drawterm-20170818/kern/devfs-win32.c:517:3: [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(path, "/"); data/drawterm-20170818/kern/devlfd.c:86:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read((int)(uintptr)c->aux, buf, n); data/drawterm-20170818/kern/devmnt.c:126: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). if(strncmp(v, VERSION9P, strlen(VERSION9P)) != 0) data/drawterm-20170818/kern/devmnt.c:136: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). k = strlen(buf); data/drawterm-20170818/kern/devmnt.c:179:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). k = devtab[c->type]->read(c, msg, 8192+IOHDRSZ, c->offset); data/drawterm-20170818/kern/devmnt.c:199: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). k = strlen(f.version); data/drawterm-20170818/kern/devssl.c:1130:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, a, n); data/drawterm-20170818/kern/devssl.c:1198: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). m = (strlen(p)*3)/2; data/drawterm-20170818/kern/devssl.c:1200: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 = dec64(x, m, p, strlen(p)); data/drawterm-20170818/kern/devssl.c:1204: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). m = (strlen(p)*3)/2 + 1; data/drawterm-20170818/kern/devssl.c:1206: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 = dec64(x, m, p, strlen(p)); data/drawterm-20170818/kern/devssl.c:1229: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(e->name) + 1; data/drawterm-20170818/kern/devssl.c:1233: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). cp += strlen(e->name); data/drawterm-20170818/kern/devssl.c:1243: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(h->name) + 1; data/drawterm-20170818/kern/devssl.c:1247: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). cp += strlen(h->name); data/drawterm-20170818/kern/devtls.c:1002: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(msg); data/drawterm-20170818/kern/devtls.c:1573: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). m = (strlen(p)*3)/2; data/drawterm-20170818/kern/devtls.c:1583: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). m = dec64(x, m, p, strlen(p)); data/drawterm-20170818/kern/devtls.c:1711: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(e->name) + 1; data/drawterm-20170818/kern/devtls.c:1715: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). cp += strlen(e->name); data/drawterm-20170818/kern/devtls.c:1725: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(h->name) + 1; data/drawterm-20170818/kern/devtls.c:1729: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). cp += strlen(h->name); data/drawterm-20170818/kern/devtls.c:1820:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(tr->err, msg, ERRMAX - 1); data/drawterm-20170818/kern/devtls.c:2166: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). q = buf + strlen(tag); data/drawterm-20170818/kern/exportfs.c:175:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = (*devtab[fs->io->type].read)(fs->io, buf, len, 0); data/drawterm-20170818/kern/exportfs.c:407:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(q->rpc.ename, err, ERRLEN); data/drawterm-20170818/kern/exportfs.c:719:26: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = (*devtab[c->type].read)(c, rpc->data, n, off); data/drawterm-20170818/kern/parse.c:86:2: [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(p, "\""); data/drawterm-20170818/kern/posix.c:179:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #undef read data/drawterm-20170818/kern/posix.c:192:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if((m = read(randfd, v, n)) != n) data/drawterm-20170818/kern/qio.c:1410:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(q->err, msg, ERRMAX-1); data/drawterm-20170818/kern/syscall.c:337:27: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nr = (*devtab[nc->type].read)((Chan*)nc, va, n, nc->offset); data/drawterm-20170818/kern/syscall.c:382:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = (*devtab[c->type].read)((Chan*)c, va, n, c->offset); data/drawterm-20170818/kern/syscall.c:618: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(syswrite(cfd, name, strlen(name)) < 0){ data/drawterm-20170818/kern/syscall.c:649:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(net, dest, sizeof(net)-1); data/drawterm-20170818/kern/syscall.c:666: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(syswrite(fd, net, strlen(net)) < 0){ data/drawterm-20170818/kern/syscall.c:699:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(reply, addr, sizeof(reply)); data/drawterm-20170818/kern/syscall.c:706:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(naddr, p, na); data/drawterm-20170818/kern/syscall.c:725: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). if(syswrite(fd, addr, strlen(addr)) < 0){ data/drawterm-20170818/kern/syscall.c:743:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(naddr, cp, na); data/drawterm-20170818/kern/syscall.c:745:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(file, reply, nf); data/drawterm-20170818/kern/sysfile.c:10:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #undef read data/drawterm-20170818/kern/sysfile.c:357:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nr = devtab[c->umc->type]->read(c->umc, va, n, c->umc->offset); data/drawterm-20170818/kern/sysfile.c:408:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = devtab[c->type]->read(c, buf, n, off); data/drawterm-20170818/kern/sysfile.c:1179: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). return strlen(buf); data/drawterm-20170818/kern/sysfile.c:1189: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). return strlen(buf); data/drawterm-20170818/libauth/attr.c:13:2: [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(buf, " "); data/drawterm-20170818/libauth/attr.c:152: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). else if(t[strlen(t)-1] == '?'){ data/drawterm-20170818/libauth/attr.c:153: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). t[strlen(t)-1] = '\0'; data/drawterm-20170818/libauth/auth_challenge.c:35:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). || auth_rpc(c->rpc, "start", p, strlen(p)) != ARok data/drawterm-20170818/libauth/auth_challenge.c:70: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(auth_rpc(c->rpc, "write", c->user, strlen(c->user)) != ARok){ data/drawterm-20170818/libauth/auth_getuserpasswd.c:51: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). if(dorpc(rpc, "start", params, strlen(params), getkey) != ARok data/drawterm-20170818/libauth/auth_getuserpasswd.c:66: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). p += strlen(p)+1; data/drawterm-20170818/libauth/auth_proxy.c:130: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). if(dorpc(rpc, "start", params, strlen(params), getkey) != ARok){ data/drawterm-20170818/libauth/auth_proxy.c:157:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). m = read(fd, buf+n, atoi(rpc->arg)-n); data/drawterm-20170818/libauth/auth_respond.c:49:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). || dorpc(rpc, "start", p, strlen(p), getkey) != ARok data/drawterm-20170818/libauth/auth_respond.c:64: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 = _strfindattr(a, "user")) != nil && strlen(s) < nuser) data/drawterm-20170818/libauth/auth_rpc.c:26: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(tab[i].verb); data/drawterm-20170818/libauth/auth_rpc.c:66: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(verb); data/drawterm-20170818/libauth/auth_rpc.c:81:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if((n=read(rpc->afd, rpc->ibuf, AuthRpcMax)) < 0) data/drawterm-20170818/libauth/auth_userpasswd.c:46: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). ch->nresp = strlen(resp); data/drawterm-20170818/libauthsrv/_asrdresp.c:13:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(fd, buf, 1) != 1){ data/drawterm-20170818/libauthsrv/opasstokey.c:11: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(p); data/drawterm-20170818/libauthsrv/opasstokey.c:17:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy((char*)t, p, n); data/drawterm-20170818/libauthsrv/passtokey.c:11: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(p); data/drawterm-20170818/libauthsrv/passtokey.c:16:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy((char*)t, p, n); data/drawterm-20170818/libauthsrv/readnvram.c:67:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fdin, line, 1); data/drawterm-20170818/libauthsrv/readnvram.c:194:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). || read(fd, buf, safelen) != safelen){ data/drawterm-20170818/libauthsrv/readnvram.c:328:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(fd, secbuf, sizeof(secbuf)) != sizeof(secbuf)) data/drawterm-20170818/libauthsrv/readnvram.c:348:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(fd, root, rootsects*sectsize) != rootsects*sectsize) data/drawterm-20170818/libc/convD2M.c:19: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/drawterm-20170818/libc/convD2M.c:45: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/drawterm-20170818/libc/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/drawterm-20170818/libc/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/drawterm-20170818/libc/dial.c:93: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). if(write(fd, buf, strlen(buf)) < 0){ data/drawterm-20170818/libc/dial.c:106: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) - 1)) > 0){ data/drawterm-20170818/libc/dial.c:140:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(cfd, name, sizeof(name)-1); data/drawterm-20170818/libc/dial.c:160: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). if(write(cfd, name, strlen(name)) < 0){ data/drawterm-20170818/libc/dial.c:187:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ds->buf, str, Maxstring); data/drawterm-20170818/libc/dirmodefmt.c:20: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/drawterm-20170818/libc/dofmt.c:251: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/drawterm-20170818/libc/fcallfmt.c:206: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/drawterm-20170818/libc/fltfmt.c:364: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). __fmtcpy(fmt, s, strlen(s), strlen(s)); data/drawterm-20170818/libc/fltfmt.c:364: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). __fmtcpy(fmt, s, strlen(s), strlen(s)); data/drawterm-20170818/libc/getpid.c:13:3: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(f, b, sizeof(b)); data/drawterm-20170818/libc/nsec.c:48:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(f, b, sizeof(uvlong)) < 0) data/drawterm-20170818/libc/nsec.c:54:29: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(seek(f, 0, 0) >= 0 && read(f, b, sizeof(b)-1) >= 0){ data/drawterm-20170818/libc/pushssl.c:20:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(ctl, buf, sizeof(buf)-1); data/drawterm-20170818/libc/pushtls.c:56:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(ctl, buf, sizeof(buf)-1); data/drawterm-20170818/libc/readn.c:13: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/drawterm-20170818/libc/sysfatal.c:15: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, buf, strlen(buf)); data/drawterm-20170818/libc/time.c:26:32: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(seek(f, 0, 0) < 0 || (i = read(f, b, sizeof(b))) < 0){ data/drawterm-20170818/libc/truerand.c:14:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(randfd, &x, sizeof(x)) != sizeof(x)) data/drawterm-20170818/libc/utfutf.c:21: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/drawterm-20170818/libdraw/alloc.c:109: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); data/drawterm-20170818/libdraw/alloc.c:178: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); data/drawterm-20170818/libmemdraw/openmemsubfont.c:23:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(fd, hdr, 3*12) != 3*12){ data/drawterm-20170818/libmemdraw/openmemsubfont.c:31:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(fd, p, 6*(n+1)) != 6*(n+1)){ data/drawterm-20170818/libsec/decodepem.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(type); data/drawterm-20170818/libsec/hmactest.c:14: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). hmac_md5(data, strlen((char*)data), key, 4, hash, nil); data/drawterm-20170818/libsec/md4test.c:26: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). md4(p, strlen(*pp), digest, 0); data/drawterm-20170818/libsec/md5pickle.c:33: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/drawterm-20170818/libsec/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/drawterm-20170818/libsec/thumb.c:68:66: [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(strcmp(field[0], "x509") != 0 || strncmp(field[1], "sha1=", strlen("sha1=")) != 0) data/drawterm-20170818/libsec/thumb.c:70: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). field[1] += strlen("sha1="); data/drawterm-20170818/libsec/thumb.c:71: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). dec16(sum, sizeof(sum), field[1], strlen(field[1])); data/drawterm-20170818/libsec/tlshand.c:326:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(ctl, buf, sizeof(buf)-1); data/drawterm-20170818/libsec/tlshand.c:379:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(ctl, buf, sizeof(buf)-1); data/drawterm-20170818/libsec/tlshand.c:929:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nr = read(c->hand, &c->rp[nn], n - nn); data/drawterm-20170818/libsec/tlshand.c:1502:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(j, s, MaxAlgF-1); data/drawterm-20170818/libsec/tlshand.c:1526:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(j, s, MaxAlgF-1); data/drawterm-20170818/libsec/tlshand.c:1588: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). if(auth_rpc(rpc, "start", s, strlen(s)) != ARok){ data/drawterm-20170818/libsec/tlshand.c:1620: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). rv = auth_rpc(rpc, "write", p, strlen(p)); data/drawterm-20170818/libsec/tlshand.c:1700: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). int nlabel = strlen(label); data/drawterm-20170818/libsec/x509.c:185: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). d = d0 = emalloc(strlen(s)+1); data/drawterm-20170818/libsec/x509.c:1032: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). v = strlen(s); data/drawterm-20170818/libsec/x509.c:1656: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(s) + 2; /* room for ", " after */ data/drawterm-20170818/libsec/x509.c:2063:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(name, c->subject, nname); data/drawterm-20170818/libsec/x509.c:2257: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). if(strncmp(f[i],prefix,strlen(prefix))==0){ data/drawterm-20170818/libsec/x509.c:2258: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). el = mkel(mkname(&DN_oid[j],f[i]+strlen(prefix)), el); data/drawterm-20170818/main.c:90: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). ep = p+strlen(p); data/drawterm-20170818/posix-factotum.c:89: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(name)+1 > sizeof su.sun_path){ data/drawterm-20170818/readcons.c:34: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). s = erealloc(s, strlen(s)+strlen(t)+1); data/drawterm-20170818/readcons.c:34:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). s = erealloc(s, strlen(s)+strlen(t)+1); data/drawterm-20170818/readcons.c:68:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fdin, line, 1); data/drawterm-20170818/readcons.c:95: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/drawterm-20170818/readcons.c:96: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/drawterm-20170818/secstore.c:112:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int (*read)(SConn*, uchar*, int); // <0 if error; errmess in buffer data/drawterm-20170818/secstore.c:198:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(ss->fd, count, 2) != 2 || (count[0]&0x80) == 0){ data/drawterm-20170818/secstore.c:309: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). conn->write(conn, (uchar*)buf, strlen(buf)); data/drawterm-20170818/secstore.c:317:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = conn->read(conn, (uchar*)s, Maxmsg); data/drawterm-20170818/secstore.c:344: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). conn->write(conn, (uchar*)s, strlen(s)); data/drawterm-20170818/secstore.c:364:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if((n = conn->read(conn, ibw, Maxmsg)) <= 0){ data/drawterm-20170818/secstore.c:449: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). nver = strlen(ver); data/drawterm-20170818/secstore.c:450: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). nC = strlen(C); data/drawterm-20170818/secstore.c:473:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). sha1((uchar *)passphrase, strlen(passphrase), passhash, nil); data/drawterm-20170818/secstore.c:487: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). state = sha1((uchar*)mess, strlen(mess), 0, 0); data/drawterm-20170818/secstore.c:488: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). state = sha1((uchar*)C, strlen(C), 0, state); data/drawterm-20170818/secstore.c:489: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). state = sha1((uchar*)S, strlen(S), 0, state); data/drawterm-20170818/secstore.c:490: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). state = sha1((uchar*)m, strlen(m), 0, state); data/drawterm-20170818/secstore.c:491: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). state = sha1((uchar*)mu, strlen(mu), 0, state); data/drawterm-20170818/secstore.c:492: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). state = sha1((uchar*)sigma, strlen(sigma), 0, state); data/drawterm-20170818/secstore.c:493: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). state = sha1((uchar*)Hi, strlen(Hi), 0, state); data/drawterm-20170818/secstore.c:494: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). state = sha1((uchar*)mess, strlen(mess), 0, state); data/drawterm-20170818/secstore.c:495: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). state = sha1((uchar*)C, strlen(C), 0, state); data/drawterm-20170818/secstore.c:496: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). state = sha1((uchar*)S, strlen(S), 0, state); data/drawterm-20170818/secstore.c:497: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). state = sha1((uchar*)m, strlen(m), 0, state); data/drawterm-20170818/secstore.c:498: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). state = sha1((uchar*)mu, strlen(mu), 0, state); data/drawterm-20170818/secstore.c:499: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). state = sha1((uchar*)sigma, strlen(sigma), 0, state); data/drawterm-20170818/secstore.c:500: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). sha1((uchar*)Hi, strlen(Hi), digest, state); data/drawterm-20170818/secstore.c:533:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). conn->write(conn, (uchar*)mess, strlen(mess)); data/drawterm-20170818/secstore.c:578: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). conn->write(conn, (uchar*)mess2, strlen(mess2)); data/drawterm-20170818/secstore.c:582: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). memset(hexsigma, 0, strlen(hexsigma)); data/drawterm-20170818/secstore.c:621:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(pass==nil || strlen(pass)==0){ data/drawterm-20170818/secstore.c:637:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(sta==nil || strlen(sta)==0){ data/drawterm-20170818/secstore.c:641: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(sta) >= sizeof s - 3){ data/drawterm-20170818/secstore.c:646: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). conn->write(conn, (uchar*)s, strlen(s)); data/drawterm-20170818/secstore.c:653: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((rv = getfile(conn, (uchar*)pass, strlen(pass))) == nil) ANALYSIS SUMMARY: Hits = 792 Lines analyzed = 69817 in approximately 1.85 seconds (37736 lines/second) Physical Source Lines of Code (SLOC) = 58157 Hits@level = [0] 2 [1] 213 [2] 423 [3] 56 [4] 88 [5] 12 Hits@level+ = [0+] 794 [1+] 792 [2+] 579 [3+] 156 [4+] 100 [5+] 12 Hits/KSLOC@level+ = [0+] 13.6527 [1+] 13.6183 [2+] 9.95581 [3+] 2.68239 [4+] 1.71948 [5+] 0.206338 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.