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/lsof-4.93.2+dfsg/NEW/sleeper.c Examining data/lsof-4.93.2+dfsg/NEW/usage.c Examining data/lsof-4.93.2+dfsg/OLD/lsof.h Examining data/lsof-4.93.2+dfsg/OLD/main.c Examining data/lsof-4.93.2+dfsg/OLD/misc.c Examining data/lsof-4.93.2+dfsg/OLD/print.c Examining data/lsof-4.93.2+dfsg/OLD/proc.c Examining data/lsof-4.93.2+dfsg/arg.c Examining data/lsof-4.93.2+dfsg/dialects/aix/aix5/j2/j2_lock.h Examining data/lsof-4.93.2+dfsg/dialects/aix/aix5/j2/private_j2_snapshot.h Examining data/lsof-4.93.2+dfsg/dialects/aix/ddev.c Examining data/lsof-4.93.2+dfsg/dialects/aix/dfile.c Examining data/lsof-4.93.2+dfsg/dialects/aix/dlsof.h Examining data/lsof-4.93.2+dfsg/dialects/aix/dmnt.c Examining data/lsof-4.93.2+dfsg/dialects/aix/dnode.c Examining data/lsof-4.93.2+dfsg/dialects/aix/dnode1.c Examining data/lsof-4.93.2+dfsg/dialects/aix/dnode2.c Examining data/lsof-4.93.2+dfsg/dialects/aix/dproc.c Examining data/lsof-4.93.2+dfsg/dialects/aix/dproto.h Examining data/lsof-4.93.2+dfsg/dialects/aix/dsock.c Examining data/lsof-4.93.2+dfsg/dialects/aix/dstore.c Examining data/lsof-4.93.2+dfsg/dialects/aix/machine.h Examining data/lsof-4.93.2+dfsg/dialects/darwin/kmem/ddev.c Examining data/lsof-4.93.2+dfsg/dialects/darwin/kmem/dfile.c Examining data/lsof-4.93.2+dfsg/dialects/darwin/kmem/dlsof.h Examining data/lsof-4.93.2+dfsg/dialects/darwin/kmem/dmnt.c Examining data/lsof-4.93.2+dfsg/dialects/darwin/kmem/dnode.c Examining data/lsof-4.93.2+dfsg/dialects/darwin/kmem/dnode1.c Examining data/lsof-4.93.2+dfsg/dialects/darwin/kmem/dproc.c Examining data/lsof-4.93.2+dfsg/dialects/darwin/kmem/dproto.h Examining data/lsof-4.93.2+dfsg/dialects/darwin/kmem/dsock.c Examining data/lsof-4.93.2+dfsg/dialects/darwin/kmem/dstore.c Examining data/lsof-4.93.2+dfsg/dialects/darwin/kmem/machine.h Examining data/lsof-4.93.2+dfsg/dialects/darwin/libproc/ddev.c Examining data/lsof-4.93.2+dfsg/dialects/darwin/libproc/dfile.c Examining data/lsof-4.93.2+dfsg/dialects/darwin/libproc/dlsof.h Examining data/lsof-4.93.2+dfsg/dialects/darwin/libproc/dmnt.c Examining data/lsof-4.93.2+dfsg/dialects/darwin/libproc/dproc.c Examining data/lsof-4.93.2+dfsg/dialects/darwin/libproc/dproto.h Examining data/lsof-4.93.2+dfsg/dialects/darwin/libproc/dsock.c Examining data/lsof-4.93.2+dfsg/dialects/darwin/libproc/dstore.c Examining data/lsof-4.93.2+dfsg/dialects/darwin/libproc/machine.h Examining data/lsof-4.93.2+dfsg/dialects/du/ddev.c Examining data/lsof-4.93.2+dfsg/dialects/du/dfile.c Examining data/lsof-4.93.2+dfsg/dialects/du/dlsof.h Examining data/lsof-4.93.2+dfsg/dialects/du/dmnt.c Examining data/lsof-4.93.2+dfsg/dialects/du/dnode.c Examining data/lsof-4.93.2+dfsg/dialects/du/dproc.c Examining data/lsof-4.93.2+dfsg/dialects/du/dproto.h Examining data/lsof-4.93.2+dfsg/dialects/du/dsock.c Examining data/lsof-4.93.2+dfsg/dialects/du/dstore.c Examining data/lsof-4.93.2+dfsg/dialects/du/machine.h Examining data/lsof-4.93.2+dfsg/dialects/freebsd/dlsof.h Examining data/lsof-4.93.2+dfsg/dialects/freebsd/dmnt.c Examining data/lsof-4.93.2+dfsg/dialects/freebsd/dnode.c Examining data/lsof-4.93.2+dfsg/dialects/freebsd/dnode1.c Examining data/lsof-4.93.2+dfsg/dialects/freebsd/dnode2.c Examining data/lsof-4.93.2+dfsg/dialects/freebsd/dproc.c Examining data/lsof-4.93.2+dfsg/dialects/freebsd/dproto.h Examining data/lsof-4.93.2+dfsg/dialects/freebsd/dsock.c Examining data/lsof-4.93.2+dfsg/dialects/freebsd/dstore.c Examining data/lsof-4.93.2+dfsg/dialects/freebsd/dzfs.h Examining data/lsof-4.93.2+dfsg/dialects/freebsd/include/procfs/pfsnode.h Examining data/lsof-4.93.2+dfsg/dialects/freebsd/machine.h Examining data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dfile.c Examining data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dlsof.h Examining data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dmnt.c Examining data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dnode.c Examining data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dnode1.c Examining data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dnode2.c Examining data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dproc.c Examining data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dproto.h Examining data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dsock.c Examining data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dstore.c Examining data/lsof-4.93.2+dfsg/dialects/hpux/kmem/hpux11/ipc_s.h Examining data/lsof-4.93.2+dfsg/dialects/hpux/kmem/hpux11/kernbits.h Examining data/lsof-4.93.2+dfsg/dialects/hpux/kmem/hpux11/lla.h Examining data/lsof-4.93.2+dfsg/dialects/hpux/kmem/hpux11/nfs_clnt.h Examining data/lsof-4.93.2+dfsg/dialects/hpux/kmem/hpux11/proc.h Examining data/lsof-4.93.2+dfsg/dialects/hpux/kmem/hpux11/rnode.h Examining data/lsof-4.93.2+dfsg/dialects/hpux/kmem/hpux11/sth.h Examining data/lsof-4.93.2+dfsg/dialects/hpux/kmem/hpux11/tcp_s.h Examining data/lsof-4.93.2+dfsg/dialects/hpux/kmem/hpux11/udp_s.h Examining data/lsof-4.93.2+dfsg/dialects/hpux/kmem/hpux11/vnode.h Examining data/lsof-4.93.2+dfsg/dialects/hpux/kmem/machine.h Examining data/lsof-4.93.2+dfsg/dialects/hpux/pstat/dfile.c Examining data/lsof-4.93.2+dfsg/dialects/hpux/pstat/dlsof.h Examining data/lsof-4.93.2+dfsg/dialects/hpux/pstat/dproc.c Examining data/lsof-4.93.2+dfsg/dialects/hpux/pstat/dproto.h Examining data/lsof-4.93.2+dfsg/dialects/hpux/pstat/dsock.c Examining data/lsof-4.93.2+dfsg/dialects/hpux/pstat/dstore.c Examining data/lsof-4.93.2+dfsg/dialects/hpux/pstat/machine.h Examining data/lsof-4.93.2+dfsg/dialects/linux/dfile.c Examining data/lsof-4.93.2+dfsg/dialects/linux/dlsof.h Examining data/lsof-4.93.2+dfsg/dialects/linux/dmnt.c Examining data/lsof-4.93.2+dfsg/dialects/linux/dnode.c Examining data/lsof-4.93.2+dfsg/dialects/linux/dproc.c Examining data/lsof-4.93.2+dfsg/dialects/linux/dproto.h Examining data/lsof-4.93.2+dfsg/dialects/linux/dsock.c Examining data/lsof-4.93.2+dfsg/dialects/linux/dstore.c Examining data/lsof-4.93.2+dfsg/dialects/linux/machine.h Examining data/lsof-4.93.2+dfsg/dialects/n+obsd/dlsof.h Examining data/lsof-4.93.2+dfsg/dialects/n+obsd/dmnt.c Examining data/lsof-4.93.2+dfsg/dialects/n+obsd/dnode.c Examining data/lsof-4.93.2+dfsg/dialects/n+obsd/dnode1.c Examining data/lsof-4.93.2+dfsg/dialects/n+obsd/dproc.c Examining data/lsof-4.93.2+dfsg/dialects/n+obsd/dproto.h Examining data/lsof-4.93.2+dfsg/dialects/n+obsd/dsock.c Examining data/lsof-4.93.2+dfsg/dialects/n+obsd/dstore.c Examining data/lsof-4.93.2+dfsg/dialects/n+obsd/machine.h Examining data/lsof-4.93.2+dfsg/dialects/n+os/dlsof.h Examining data/lsof-4.93.2+dfsg/dialects/n+os/dnode.c Examining data/lsof-4.93.2+dfsg/dialects/n+os/dnode1.c Examining data/lsof-4.93.2+dfsg/dialects/n+os/dproc.c Examining data/lsof-4.93.2+dfsg/dialects/n+os/dproto.h Examining data/lsof-4.93.2+dfsg/dialects/n+os/dsock.c Examining data/lsof-4.93.2+dfsg/dialects/n+os/dstore.c Examining data/lsof-4.93.2+dfsg/dialects/n+os/machine.h Examining data/lsof-4.93.2+dfsg/dialects/osr/dfile.c Examining data/lsof-4.93.2+dfsg/dialects/osr/dlsof.h Examining data/lsof-4.93.2+dfsg/dialects/osr/dmnt.c Examining data/lsof-4.93.2+dfsg/dialects/osr/dnode.c Examining data/lsof-4.93.2+dfsg/dialects/osr/dproc.c Examining data/lsof-4.93.2+dfsg/dialects/osr/dproto.h Examining data/lsof-4.93.2+dfsg/dialects/osr/dsock.c Examining data/lsof-4.93.2+dfsg/dialects/osr/dstore.c Examining data/lsof-4.93.2+dfsg/dialects/osr/include/netdb.h Examining data/lsof-4.93.2+dfsg/dialects/osr/include/sys/cdefs.h Examining data/lsof-4.93.2+dfsg/dialects/osr/machine.h Examining data/lsof-4.93.2+dfsg/dialects/sun/ddev.c Examining data/lsof-4.93.2+dfsg/dialects/sun/dfile.c Examining data/lsof-4.93.2+dfsg/dialects/sun/dlsof.h Examining data/lsof-4.93.2+dfsg/dialects/sun/dmnt.c Examining data/lsof-4.93.2+dfsg/dialects/sun/dnode.c Examining data/lsof-4.93.2+dfsg/dialects/sun/dnode1.c Examining data/lsof-4.93.2+dfsg/dialects/sun/dnode2.c Examining data/lsof-4.93.2+dfsg/dialects/sun/dproc.c Examining data/lsof-4.93.2+dfsg/dialects/sun/dproto.h Examining data/lsof-4.93.2+dfsg/dialects/sun/dsock.c Examining data/lsof-4.93.2+dfsg/dialects/sun/dstore.c Examining data/lsof-4.93.2+dfsg/dialects/sun/machine.h Examining data/lsof-4.93.2+dfsg/lib/ckkv.c Examining data/lsof-4.93.2+dfsg/lib/cvfs.c Examining data/lsof-4.93.2+dfsg/lib/dvch.c Examining data/lsof-4.93.2+dfsg/lib/fino.c Examining data/lsof-4.93.2+dfsg/lib/isfn.c Examining data/lsof-4.93.2+dfsg/lib/lkud.c Examining data/lsof-4.93.2+dfsg/lib/pdvn.c Examining data/lsof-4.93.2+dfsg/lib/prfp.c Examining data/lsof-4.93.2+dfsg/lib/ptti.c Examining data/lsof-4.93.2+dfsg/lib/rdev.c Examining data/lsof-4.93.2+dfsg/lib/regex.c Examining data/lsof-4.93.2+dfsg/lib/rmnt.c Examining data/lsof-4.93.2+dfsg/lib/rnam.c Examining data/lsof-4.93.2+dfsg/lib/rnch.c Examining data/lsof-4.93.2+dfsg/lib/rnmh.c Examining data/lsof-4.93.2+dfsg/lib/snpf.c Examining data/lsof-4.93.2+dfsg/lsof.h Examining data/lsof-4.93.2+dfsg/lsof_fields.h Examining data/lsof-4.93.2+dfsg/main.c Examining data/lsof-4.93.2+dfsg/misc.c Examining data/lsof-4.93.2+dfsg/node.c Examining data/lsof-4.93.2+dfsg/print.c Examining data/lsof-4.93.2+dfsg/proc.c Examining data/lsof-4.93.2+dfsg/proto.h Examining data/lsof-4.93.2+dfsg/regex.h Examining data/lsof-4.93.2+dfsg/store.c Examining data/lsof-4.93.2+dfsg/tests/LTbasic.c Examining data/lsof-4.93.2+dfsg/tests/LTbigf.c Examining data/lsof-4.93.2+dfsg/tests/LTdnlc.c Examining data/lsof-4.93.2+dfsg/tests/LTlock.c Examining data/lsof-4.93.2+dfsg/tests/LTnfs.c Examining data/lsof-4.93.2+dfsg/tests/LTnlink.c Examining data/lsof-4.93.2+dfsg/tests/LTsock.c Examining data/lsof-4.93.2+dfsg/tests/LTszoff.c Examining data/lsof-4.93.2+dfsg/tests/LTunix.c Examining data/lsof-4.93.2+dfsg/tests/LsofTest.h Examining data/lsof-4.93.2+dfsg/tests/LTlib.c Examining data/lsof-4.93.2+dfsg/usage.c Examining data/lsof-4.93.2+dfsg/util.c FINAL RESULTS: data/lsof-4.93.2+dfsg/OLD/misc.c:457:9: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. return(readlink(path, rbuf, rbln)); data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:539:12: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. if ((ll = readlink(ln, src, srcl - 1)) < 1 data/lsof-4.93.2+dfsg/dialects/osr/dlsof.h:148:9: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. #define readlink(path, buf, len) (-1) data/lsof-4.93.2+dfsg/lib/dvch.c:736:8: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. if (chown(DCpath[DCpathX], Myuid, getgid()) < 0) data/lsof-4.93.2+dfsg/misc.c:457:9: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. return(readlink(path, rbuf, rbln)); data/lsof-4.93.2+dfsg/NEW/usage.c:376:13: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void) fprintf(stderr, data/lsof-4.93.2+dfsg/NEW/usage.c:504:13: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void) fprintf(stderr, data/lsof-4.93.2+dfsg/OLD/lsof.h:750:7: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. char access; data/lsof-4.93.2+dfsg/OLD/misc.c:1020:6: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access(path, R_OK) < 0) { data/lsof-4.93.2+dfsg/OLD/misc.c:1022:10: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void) fprintf(stderr, ACCESSERRFMT, Pn, path, strerror(errno)); data/lsof-4.93.2+dfsg/OLD/print.c:858:27: [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. (Lf->lock == ' ') ? Lf->access data/lsof-4.93.2+dfsg/OLD/print.c:860:14: [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. : Lf->access, data/lsof-4.93.2+dfsg/OLD/print.c:866:27: [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. (Lf->lock == ' ') ? Lf->access data/lsof-4.93.2+dfsg/OLD/print.c:868:14: [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. : Lf->access, data/lsof-4.93.2+dfsg/OLD/print.c:1033:10: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void) printf(SzOffFmt_dv, SzOffColW, Lf->sz); data/lsof-4.93.2+dfsg/OLD/proc.c:994:9: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. ef->access); data/lsof-4.93.2+dfsg/OLD/proc.c:1029:9: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. ef->access); data/lsof-4.93.2+dfsg/OLD/proc.c:1237:28: [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. LSOF_FID_ACCESS, Lf->access, Terminator); data/lsof-4.93.2+dfsg/OLD/proc.c:1344:10: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void) printf(InodeFmt_d, Lf->inode); data/lsof-4.93.2+dfsg/dialects/aix/dproc.c:288:6: [4] (shell) execl: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execl(OSLEVELPATH, OSLEVEL, NULL); data/lsof-4.93.2+dfsg/dialects/aix/machine.h:656:14: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snpf snprintf /* use the system's snprintf() */ data/lsof-4.93.2+dfsg/dialects/darwin/kmem/machine.h:612:14: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snpf snprintf /* use the system's snprintf() */ data/lsof-4.93.2+dfsg/dialects/darwin/libproc/machine.h:597:14: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snpf snprintf /* use the system's snprintf() */ data/lsof-4.93.2+dfsg/dialects/du/dproc.c:1273:13: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). (void) strcpy(buf, Lf->fsdir); data/lsof-4.93.2+dfsg/dialects/du/dproc.c:1276:13: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). (void) strcpy(&buf[len], cp); data/lsof-4.93.2+dfsg/dialects/du/machine.h:611:14: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snpf snprintf /* use the system's snprintf() */ data/lsof-4.93.2+dfsg/dialects/freebsd/machine.h:652:14: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snpf snprintf /* use the system's snprintf() */ data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dnode.c:835:21: [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 (Fsize || (Lf->access != 'r' && Lf->access != 'w')) { data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dnode.c:835:42: [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 (Fsize || (Lf->access != 'r' && Lf->access != 'w')) { data/lsof-4.93.2+dfsg/dialects/hpux/kmem/machine.h:635:14: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snpf snprintf /* use the system's snprintf() */ data/lsof-4.93.2+dfsg/dialects/hpux/pstat/machine.h:613:14: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snpf snprintf /* use the system's snprintf() */ data/lsof-4.93.2+dfsg/dialects/linux/dfile.c:356:13: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). (void) strcpy(Namech, p); data/lsof-4.93.2+dfsg/dialects/linux/dmnt.c:342:10: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). (void) strcpy(mpn->dn, path); data/lsof-4.93.2+dfsg/dialects/linux/dnode.c:683:9: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. mode_t access; data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:1683:9: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). (void) strcpy(cb, p); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1070:46: [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. ep->pid, CmdLim, ep->cmd, &ef->fd[i], ef->access); data/lsof-4.93.2+dfsg/dialects/linux/machine.h:610:14: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snpf snprintf /* use the system's snprintf() */ data/lsof-4.93.2+dfsg/dialects/n+obsd/machine.h:588:14: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snpf snprintf /* use the system's snprintf() */ data/lsof-4.93.2+dfsg/dialects/osr/machine.h:579:14: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snpf snprintf /* use the system's snprintf() */ data/lsof-4.93.2+dfsg/dialects/sun/dlsof.h:119:9: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define printf __kernel_printf data/lsof-4.93.2+dfsg/dialects/sun/dlsof.h:120:9: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snprintf __kernel_snprintf data/lsof-4.93.2+dfsg/dialects/sun/dlsof.h:121:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. #define sprintf __kernel_sprintf data/lsof-4.93.2+dfsg/dialects/sun/dlsof.h:124:9: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define vprintf __kernel_vprintf data/lsof-4.93.2+dfsg/dialects/sun/dlsof.h:125:9: [4] (buffer) vsprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. #define vsprintf __kernel_vsprintf data/lsof-4.93.2+dfsg/dialects/sun/dlsof.h:126:9: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define vsnprintf __kernel_vsnprintf data/lsof-4.93.2+dfsg/dialects/sun/dlsof.h:135:8: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #undef printf data/lsof-4.93.2+dfsg/dialects/sun/dlsof.h:136:8: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #undef snprintf data/lsof-4.93.2+dfsg/dialects/sun/dlsof.h:137:8: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. #undef sprintf data/lsof-4.93.2+dfsg/dialects/sun/dlsof.h:140:8: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #undef vprintf data/lsof-4.93.2+dfsg/dialects/sun/dlsof.h:141:8: [4] (buffer) vsprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. #undef vsprintf data/lsof-4.93.2+dfsg/dialects/sun/dlsof.h:142:8: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #undef vsnprintf data/lsof-4.93.2+dfsg/dialects/sun/dlsof.h:223:9: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define printf lsof_printf data/lsof-4.93.2+dfsg/dialects/sun/dlsof.h:224:9: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snprintf lsof_snprintf data/lsof-4.93.2+dfsg/dialects/sun/dlsof.h:225:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. #define sprintf lsof_sprintf data/lsof-4.93.2+dfsg/dialects/sun/dlsof.h:227:9: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define vprintf lsof_vprintf data/lsof-4.93.2+dfsg/dialects/sun/dlsof.h:228:9: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define vsnprintf lsof_vsnprintf data/lsof-4.93.2+dfsg/dialects/sun/dlsof.h:229:9: [4] (buffer) vsprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. #define vsprintf lsof_vsprintf data/lsof-4.93.2+dfsg/dialects/sun/dlsof.h:231:8: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #undef printf data/lsof-4.93.2+dfsg/dialects/sun/dlsof.h:232:8: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #undef snprintf data/lsof-4.93.2+dfsg/dialects/sun/dlsof.h:233:8: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. #undef sprintf data/lsof-4.93.2+dfsg/dialects/sun/dlsof.h:235:8: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #undef vprintf data/lsof-4.93.2+dfsg/dialects/sun/dlsof.h:236:8: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #undef vsnprintf data/lsof-4.93.2+dfsg/dialects/sun/dlsof.h:237:8: [4] (buffer) vsprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. #undef vsprintf data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:832:12: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. (void) snprintf(kernmod, sizeof(kernmod) - 1, t, isa); data/lsof-4.93.2+dfsg/dialects/sun/dproc.c:1807:13: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). (void) strcpy(buf, Lf->fsdir); data/lsof-4.93.2+dfsg/dialects/sun/dproc.c:1810:13: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). (void) strcpy(&buf[len], cp); data/lsof-4.93.2+dfsg/dialects/sun/dproc.c:2213:9: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). (void) strcpy(cp, lc->nm); data/lsof-4.93.2+dfsg/dialects/sun/machine.h:721:14: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snpf snprintf /* use the system's snprintf() */ data/lsof-4.93.2+dfsg/lib/dvch.c:439:10: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). (void) strcpy(&buf[i], p->pw_dir); data/lsof-4.93.2+dfsg/lib/dvch.c:475:14: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). (void) strcpy(&buf[i], hn); data/lsof-4.93.2+dfsg/lib/dvch.c:506:11: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). (void) strcpy(&buf[i], cp2); data/lsof-4.93.2+dfsg/lib/dvch.c:557:10: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). (void) strcpy(&buf[i], p->pw_name); data/lsof-4.93.2+dfsg/lib/dvch.c:570:14: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). (void) strcpy(&buf[i], hn); data/lsof-4.93.2+dfsg/lib/dvch.c:668:14: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void) fprintf(stderr, ACCESSERRFMT, data/lsof-4.93.2+dfsg/lib/isfn.c:404:13: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). (void) strcpy(Namech, p); data/lsof-4.93.2+dfsg/lib/regex.c:689:37: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. # define DEBUG_PRINT1(x) if (debug) printf (x) data/lsof-4.93.2+dfsg/lib/regex.c:690:42: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. # define DEBUG_PRINT2(x1, x2) if (debug) printf (x1, x2) data/lsof-4.93.2+dfsg/lib/regex.c:691:46: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. # define DEBUG_PRINT3(x1, x2, x3) if (debug) printf (x1, x2, x3) data/lsof-4.93.2+dfsg/lib/regex.c:692:50: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. # define DEBUG_PRINT4(x1, x2, x3, x4) if (debug) printf (x1, x2, x3, x4) data/lsof-4.93.2+dfsg/lib/rmnt.c:204:13: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). (void) strcpy(mtp->MOUNTS_FSTYPE, mp->RMNT_FSTYPE); data/lsof-4.93.2+dfsg/lib/rnam.c:245:13: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). (void) strcpy(buf, Lf->fsdir); data/lsof-4.93.2+dfsg/lib/rnam.c:248:13: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). (void) strcpy(&buf[len], cp); data/lsof-4.93.2+dfsg/lib/rnam.c:634:9: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). (void) strcpy(cp, lc->nm); data/lsof-4.93.2+dfsg/lib/rnch.c:286:13: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). (void) strcpy(buf, Lf->fsdir); data/lsof-4.93.2+dfsg/lib/rnch.c:289:13: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). (void) strcpy(&buf[len], cp); data/lsof-4.93.2+dfsg/lib/rnch.c:783:9: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). (void) strcpy(cp, lc->nm); data/lsof-4.93.2+dfsg/lib/rnmh.c:280:13: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). (void) strcpy(buf, Lf->fsdir); data/lsof-4.93.2+dfsg/lib/rnmh.c:283:13: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). (void) strcpy(&buf[len], cp); data/lsof-4.93.2+dfsg/lib/rnmh.c:711:9: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). (void) strcpy(cp, lc->nm); data/lsof-4.93.2+dfsg/lsof.h:759:7: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. char access; data/lsof-4.93.2+dfsg/misc.c:1020:6: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access(path, R_OK) < 0) { data/lsof-4.93.2+dfsg/misc.c:1022:10: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void) fprintf(stderr, ACCESSERRFMT, Pn, path, strerror(errno)); data/lsof-4.93.2+dfsg/print.c:875:27: [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. (Lf->lock == ' ') ? Lf->access data/lsof-4.93.2+dfsg/print.c:877:14: [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. : Lf->access, data/lsof-4.93.2+dfsg/print.c:883:27: [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. (Lf->lock == ' ') ? Lf->access data/lsof-4.93.2+dfsg/print.c:885:14: [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. : Lf->access, data/lsof-4.93.2+dfsg/print.c:1050:10: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void) printf(SzOffFmt_dv, SzOffColW, Lf->sz); data/lsof-4.93.2+dfsg/proc.c:1010:9: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. ef->access); data/lsof-4.93.2+dfsg/proc.c:1045:9: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. ef->access); data/lsof-4.93.2+dfsg/proc.c:1253:28: [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. LSOF_FID_ACCESS, Lf->access, Terminator); data/lsof-4.93.2+dfsg/proc.c:1360:10: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void) printf(InodeFmt_d, Lf->inode); data/lsof-4.93.2+dfsg/proc.c:1511: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. ef->access); data/lsof-4.93.2+dfsg/proc.c:1515: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. ef->access); data/lsof-4.93.2+dfsg/tests/LTbigf.c:711:10: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. (void) snprintf(buf, sizeof(buf) - 1, data/lsof-4.93.2+dfsg/tests/LTdnlc.c:199: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. (void) system(lsbuf); data/lsof-4.93.2+dfsg/tests/LTlib.c:533:9: [4] (shell) execv: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. (void) execv(LsofPath, av); data/lsof-4.93.2+dfsg/tests/LTlib.c:725:9: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access(LsofPath, X_OK) < 0) { data/lsof-4.93.2+dfsg/tests/LTlib.c:767:12: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). (void) strcpy(rp, src); data/lsof-4.93.2+dfsg/tests/LsofTest.h:153:9: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snprintf snpf /* use lsof's snpf() */ data/lsof-4.93.2+dfsg/tests/LsofTest.h:259:9: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snprintf snpf data/lsof-4.93.2+dfsg/usage.c:454:13: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void) fprintf(stderr, data/lsof-4.93.2+dfsg/NEW/usage.c:137: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. cp = getenv(HASPERSDCPATH); data/lsof-4.93.2+dfsg/NEW/usage.c:174: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. cp = getenv(HASPERSDCPATH); data/lsof-4.93.2+dfsg/lib/dvch.c:331: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 ((cp1 = getenv(HASENVDC)) && (l = strlen(cp1)) > 0 data/lsof-4.93.2+dfsg/lib/dvch.c:495: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. if ((cp2 = getenv(HASPERSDCPATH)) data/lsof-4.93.2+dfsg/tests/LTdnlc.c:167:10: [3] (buffer) getwd: This does not protect against buffer overflows by itself, so use with caution (CWE-120, CWE-20). Use getcwd instead. if (!getwd(cwd)) data/lsof-4.93.2+dfsg/tests/LTlib.c:583: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. if ((tcp = getenv("LT_LSOF_PATH"))) data/lsof-4.93.2+dfsg/tests/LTunix.c:124:10: [3] (buffer) getwd: This does not protect against buffer overflows by itself, so use with caution (CWE-120, CWE-20). Use getcwd instead. if (!getwd(cwd)) data/lsof-4.93.2+dfsg/usage.c:165: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. cp = getenv(HASPERSDCPATH); data/lsof-4.93.2+dfsg/usage.c:202: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. cp = getenv(HASPERSDCPATH); data/lsof-4.93.2+dfsg/NEW/usage.c:310:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN+1], *cp, *cp1, *cp2; data/lsof-4.93.2+dfsg/OLD/lsof.h:793:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fd[FDLEN]; data/lsof-4.93.2+dfsg/OLD/lsof.h:794:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char iproto[IPROTOL]; data/lsof-4.93.2+dfsg/OLD/lsof.h:795:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char type[TYPEL]; data/lsof-4.93.2+dfsg/OLD/lsof.h:990:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char a[MAX_AF_ADDR]; /* address */ data/lsof-4.93.2+dfsg/OLD/main.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 options[128]; data/lsof-4.93.2+dfsg/OLD/main.c:134: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). while (((i = open("/dev/null", O_RDWR, 0)) >= 0) && (i < 2)) data/lsof-4.93.2+dfsg/OLD/main.c:289:26: [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). CmdLim = TaskCmdLim = atoi(GOv); data/lsof-4.93.2+dfsg/OLD/misc.c:297:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char r_arg[MAXPATHLEN+1], r_rbuf[MAXPATHLEN+1]; data/lsof-4.93.2+dfsg/OLD/misc.c:1058:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char abuf[MAXPATHLEN+1]; data/lsof-4.93.2+dfsg/OLD/misc.c:1063:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char lbuf[MAXPATHLEN+1]; data/lsof-4.93.2+dfsg/OLD/misc.c:1069:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[MAXPATHLEN+1]; data/lsof-4.93.2+dfsg/OLD/misc.c:1354: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 up[8]; data/lsof-4.93.2+dfsg/OLD/print.c:55:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char a[MAX_AF_ADDR]; /* numeric address */ data/lsof-4.93.2+dfsg/OLD/print.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[128], *cp, *nm; data/lsof-4.93.2+dfsg/OLD/print.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 hbuf[256]; data/lsof-4.93.2+dfsg/OLD/print.c:478: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 pb[128]; data/lsof-4.93.2+dfsg/OLD/print.c:666:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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/lsof-4.93.2+dfsg/OLD/print.c:1135:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pbuf[32]; data/lsof-4.93.2+dfsg/OLD/print.c:2000:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN]; data/lsof-4.93.2+dfsg/OLD/print.c:2250: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[64]; data/lsof-4.93.2+dfsg/OLD/print.c:2312:6: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nm[LOGINML+1]; data/lsof-4.93.2+dfsg/OLD/print.c:2316: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[USERPRTL+1]; data/lsof-4.93.2+dfsg/OLD/proc.c:957:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nma[1024]; /* name addition buffer */ data/lsof-4.93.2+dfsg/OLD/proc.c:1059:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char xbuf[64]; data/lsof-4.93.2+dfsg/OLD/proc.c:1123:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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], *cp; data/lsof-4.93.2+dfsg/arg.c:442: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). pid = atoi(&path[pfsnl+1]); data/lsof-4.93.2+dfsg/arg.c:589:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char reb[256], *xb, *xe, *xm; data/lsof-4.93.2+dfsg/arg.c:874:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256], *cp; data/lsof-4.93.2+dfsg/arg.c:982:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *av[2]; data/lsof-4.93.2+dfsg/arg.c:2233:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char lnm[LOGINML+1], *lp; data/lsof-4.93.2+dfsg/arg.c:2479:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy((void *)&n->a[0], (void *)he->h_addr, he->h_length); data/lsof-4.93.2+dfsg/dialects/aix/ddev.c:571:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN*2], *cp; data/lsof-4.93.2+dfsg/dialects/aix/ddev.c:596:15: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if ((n = atoi(&buf[len])) < 0) data/lsof-4.93.2+dfsg/dialects/aix/dfile.c:440: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[128]; data/lsof-4.93.2+dfsg/dialects/aix/dnode.c:198:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32], *ty; data/lsof-4.93.2+dfsg/dialects/aix/dnode.c:255:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char mn[32]; data/lsof-4.93.2+dfsg/dialects/aix/dnode1.c:54:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char d1[2]; data/lsof-4.93.2+dfsg/dialects/aix/dnode1.c:253:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *cp, tbuf[32]; data/lsof-4.93.2+dfsg/dialects/aix/dproc.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 *dummy7[3]; data/lsof-4.93.2+dfsg/dialects/aix/dproc.c:243:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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], *cp; data/lsof-4.93.2+dfsg/dialects/aix/dproc.c:314:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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/lsof-4.93.2+dfsg/dialects/aix/dproc.c:814: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 ((Km = open("/dev/mem", O_RDONLY, 0)) < 0) { data/lsof-4.93.2+dfsg/dialects/aix/dproc.c:838: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 ((Kd = open(Memory ? Memory : KMEM, O_RDONLY, 0)) < 0) { data/lsof-4.93.2+dfsg/dialects/aix/dproc.c:934:36: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. if (((char *)a + sizeof(le)) <= ((char *)Nl[X_UADDR].n_value + U_SIZE)) data/lsof-4.93.2+dfsg/dialects/aix/dproc.c:974:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[LIBNMLN]; data/lsof-4.93.2+dfsg/dialects/aix/dproc.c:1018:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[65536]; data/lsof-4.93.2+dfsg/dialects/aix/dproc.c:1219:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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, fd[8]; data/lsof-4.93.2+dfsg/dialects/aix/dproc.c:1344:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN+1], fd[8], *nm, *pp; data/lsof-4.93.2+dfsg/dialects/darwin/kmem/dfile.c:76:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char psem_name[PSEMNAMLEN + 1]; data/lsof-4.93.2+dfsg/dialects/darwin/kmem/dfile.c:94:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pshm_name[PSHMNAMLEN + 1]; data/lsof-4.93.2+dfsg/dialects/darwin/kmem/dnode.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 *pp, vn[MAXPATHLEN+1]; data/lsof-4.93.2+dfsg/dialects/darwin/kmem/dnode.c:341:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char dev_ch[32]; data/lsof-4.93.2+dfsg/dialects/darwin/kmem/dproc.c:443: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 ((Kd = open(Memory ? Memory : KMEM, O_RDONLY, 0)) < 0) data/lsof-4.93.2+dfsg/dialects/darwin/kmem/dsock.c:87:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[IFNAMSIZ]; data/lsof-4.93.2+dfsg/dialects/darwin/libproc/dfile.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 buf[32], *cp; data/lsof-4.93.2+dfsg/dialects/darwin/libproc/dfile.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 dev_ch[32], *ep; data/lsof-4.93.2+dfsg/dialects/du/dfile.c:81:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN+1]; data/lsof-4.93.2+dfsg/dialects/du/dfile.c:109: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[128]; data/lsof-4.93.2+dfsg/dialects/du/dmnt.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 fb[MAX_MNT_PATHLEN+1]; data/lsof-4.93.2+dfsg/dialects/du/dmnt.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 ob[MAX_MNT_PATHLEN+1]; data/lsof-4.93.2+dfsg/dialects/du/dproc.c:216: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. if (kread((KA_T)((char *)Pa[px] + sizeof(struct proc)), data/lsof-4.93.2+dfsg/dialects/du/dproc.c:257: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. process_text((KA_T)((char *)Pa[px] - sizeof(struct task))); data/lsof-4.93.2+dfsg/dialects/du/dproc.c:471: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 ((Kd = open(Memory ? Memory : KMEM, O_RDONLY, 0)) < 0) { data/lsof-4.93.2+dfsg/dialects/du/dproc.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 *ba, buf[MAXPATHLEN+2], *ps; data/lsof-4.93.2+dfsg/dialects/du/dproc.c:1226:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN]; data/lsof-4.93.2+dfsg/dialects/du/dproc.c:1390:23: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. pp[i] = (KA_T)((char *)pp[i] data/lsof-4.93.2+dfsg/dialects/freebsd/dlsof.h:385: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). int open(const char *, int, ...); data/lsof-4.93.2+dfsg/dialects/freebsd/dlsof.h:500:8: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #undef bcopy /* avoid _KERNEL conflict */ data/lsof-4.93.2+dfsg/dialects/freebsd/dlsof.h:503:8: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #undef memcpy /* avoid _KERNEL conflict */ data/lsof-4.93.2+dfsg/dialects/freebsd/dlsof.h:662:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nc_name[16]; /* segment name -- Strictly composed, data/lsof-4.93.2+dfsg/dialects/freebsd/dnode.c:275:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char dev_ch[32], *ep; data/lsof-4.93.2+dfsg/dialects/freebsd/dnode.c:352:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char vtbuf[32]; data/lsof-4.93.2+dfsg/dialects/freebsd/dnode.c:366:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char dbuf[32]; data/lsof-4.93.2+dfsg/dialects/freebsd/dnode.c:368:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *dp, *np, tbuf[1024]; data/lsof-4.93.2+dfsg/dialects/freebsd/dnode.c:1615:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char dev_ch[32], *ep; data/lsof-4.93.2+dfsg/dialects/freebsd/include/procfs/pfsnode.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 d_nam[8]; data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dfile.c:83: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[128]; data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dfile.c:196:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char mn[32]; data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dnode.c:325:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32], *ty; data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dnode.c:332:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fb[128]; data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dnode.c:1087:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dnode2.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 *cp, tbuf[32]; data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dproc.c:199: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 u_comm[PST_CLEN]; data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dproc.c:205:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char us[U_SIZE]; /* must read HP-UX SWAP in DEV_BSIZE chunks */ data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dproc.c:545: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 ((Mem = open("/dev/mem", O_RDONLY, 0)) < 0) { data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dproc.c:551:18: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((Swap = open(SWAP, O_RDONLY, 0)) < 0) { data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dproc.c:577: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 ((Kd = open(Memory ? Memory : KMEM, O_RDONLY, 0)) < 0) { data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dproc.c:615:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy((void *)nl, (void *)Nl, (size_t)Nll); data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dproc.c:751:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fd[FDLEN]; data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dsock.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 sbuf[128]; data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dsock.c:483:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *ep, tbuf[32]; data/lsof-4.93.2+dfsg/dialects/hpux/kmem/hpux11/nfs_clnt.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 mi_hostname[32]; data/lsof-4.93.2+dfsg/dialects/hpux/kmem/hpux11/nfs_clnt.h:71:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char mi_fsmnt[512]; data/lsof-4.93.2+dfsg/dialects/hpux/kmem/hpux11/proc.h:229:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char p_comm[15]; data/lsof-4.93.2+dfsg/dialects/hpux/kmem/hpux11/proc.h: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 p_spare[48]; data/lsof-4.93.2+dfsg/dialects/hpux/kmem/hpux11/rnode.h: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 fh_buf[64]; data/lsof-4.93.2+dfsg/dialects/hpux/kmem/hpux11/tcp_s.h:208:6: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tcp_u_buf[128]; data/lsof-4.93.2+dfsg/dialects/hpux/pstat/dfile.c:629: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[128]; data/lsof-4.93.2+dfsg/dialects/hpux/pstat/dfile.c:648:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *cp, buf[32]; data/lsof-4.93.2+dfsg/dialects/hpux/pstat/dsock.c:445:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy((void *)s->pst_boundaddr, data/lsof-4.93.2+dfsg/dialects/hpux/pstat/dsock.c:452:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy((void *)s->pst_remaddr, data/lsof-4.93.2+dfsg/dialects/hpux/pstat/dsock.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 sbuf[128]; data/lsof-4.93.2+dfsg/dialects/hpux/pstat/dsock.c:962:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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], tbuf[32]; data/lsof-4.93.2+dfsg/dialects/linux/dfile.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 buf[128]; data/lsof-4.93.2+dfsg/dialects/linux/dmnt.c:205:6: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[(MAXPATHLEN*2) + 1], *dp, path[(MAXPATHLEN*2) + 1]; data/lsof-4.93.2+dfsg/dialects/linux/dmnt.c:421:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN], *cp, **fp; data/lsof-4.93.2+dfsg/dialects/linux/dnode.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[MAXPATHLEN], *ec, **fp; data/lsof-4.93.2+dfsg/dialects/linux/dnode.c:592: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). pid = atoi(fp[4]); data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:201:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmdbuf[MAXPATHLEN]; data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:437:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN + 1], *ep, **fp; data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:453:26: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!p || !*p || !(fs = fopen(p, "r"))) data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:564:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[MAXPATHLEN]; data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:583:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(LSTAT_TEST_FILE, O_RDONLY)) >= 0) { data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:694:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nmabuf[MAXPATHLEN + 1]; data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:807:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!(fs = fopen(p, m))) { data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:883:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nmabuf[MAXPATHLEN + 1], pbuf[MAXPATHLEN + 1]; data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:1292:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN + 1], *ep, fmtbuf[32], **fp, nmabuf[MAXPATHLEN + 1]; data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:1525:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN], *cp, *cp1, **fp; data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:1553: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). if (atoi(cp1) != id) data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:1621: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). *ppid = atoi(fp[1]); data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:1625: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). *pgid = atoi(fp[2]); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:625:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN], *da, *dev_ch, *ep, **fp, *sa; data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1050:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nma[1024]; /* character buffer */ data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1053:9: [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. (void) strcpy(nma, "->INO="); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1186:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN], *ep, **fp, *la, *ra; data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1326:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN], *ep, **fp, *la, *ra; data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1485:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN], *ep, **fp; data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1561:11: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). pr = atoi(fp[1]); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1589:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN], *ep, **fp; data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1668:11: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). ty = atoi(fp[2]); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1701:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN], *ep, **fp, *la, *ra, *sp; data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1850:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN], *a, *ep, **fp, *id, *la, *lp, *ra, *rp, *ta; data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2225:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN], *ep, **fp; data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2256:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fs = fopen(SockStatPath, "r"))) { data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2264:20: [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 ((h = atoi(fp[2])) < 1) data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2394:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN], *ep, **fp, *la, *ra, *sp; data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2548:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN], *ep, **fp; data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2578:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fs = fopen(SockStatPath6, "r"))) { data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2588:17: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if ((h = atoi(fp[2])) < 1) data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2593:17: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if ((h = atoi(fp[2])) < 1) data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2724:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN], *ep, **fp, *path, *pcb; data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2924:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[9], *ep; data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2990:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *cp, pbuf[1024]; data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:3043:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *cp, pbuf[256]; data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:3070:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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/lsof-4.93.2+dfsg/dialects/linux/dsock.c:3183:21: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *cp, *path = (char *)NULL, tbuf[64]; data/lsof-4.93.2+dfsg/dialects/n+obsd/dlsof.h: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 type[MFSNAMELEN]; /* type of file system */ data/lsof-4.93.2+dfsg/dialects/n+obsd/dnode.c:248:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ktnm[MAXPATHLEN+1]; data/lsof-4.93.2+dfsg/dialects/n+obsd/dproc.c:69:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char v[64]; data/lsof-4.93.2+dfsg/dialects/n+os/dnode.c:292:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32], *ty; data/lsof-4.93.2+dfsg/dialects/n+os/dnode1.c:60:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char d1[4]; data/lsof-4.93.2+dfsg/dialects/n+os/dnode1.c:62:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char d1[6]; data/lsof-4.93.2+dfsg/dialects/n+os/dnode1.c:77:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char d2[2]; data/lsof-4.93.2+dfsg/dialects/n+os/dproc.c: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 m[128], *t; data/lsof-4.93.2+dfsg/dialects/n+os/dproc.c:314: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 ((Kd = open(Memory ? Memory : KMEM, O_RDONLY, 0)) < 0) { data/lsof-4.93.2+dfsg/dialects/n+os/dproc.c:349:10: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) bcopy((char *)Nl, (char *)nl, Nll); data/lsof-4.93.2+dfsg/dialects/osr/dfile.c:76: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[128]; data/lsof-4.93.2+dfsg/dialects/osr/dfile.c:93: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[128]; data/lsof-4.93.2+dfsg/dialects/osr/dmnt.c:59:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char dvnm[MAXPATHLEN], fsnm[MAXPATHLEN]; data/lsof-4.93.2+dfsg/dialects/osr/dmnt.c:72:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(MNTTAB, O_RDONLY, 0)) < 0) { data/lsof-4.93.2+dfsg/dialects/osr/dnode.c:97:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *cp, tbuf[32]; data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:301:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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/lsof-4.93.2+dfsg/dialects/osr/dproc.c:562:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *bfp, b1[MAXPATHLEN+1], b2[MAXPATHLEN+1], *pp, *tp; data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:581:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((bf = fopen("/etc/ps/booted.system", "r"))) { data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:685:15: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char sc[sizeof(struct scoutsname)]; data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:764: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 ((Kd = open(Memory ? Memory : KMEM, O_RDONLY, 0)) < 0) { data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:787:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *ty, tyb[8]; data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:903:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[FSTYPSZ+1]; data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:1007:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nm[MAXNSZ+1]; /* name */ data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:1114:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nm[DNLC_NAMELEN+1]; data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:1232:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nm[DTNCMAX+1]; data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:1313:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nm[DIRSIZ+1]; data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:1777:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nm[NC_NAMLEN+1]; data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:1928:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nm[DIRSIZ+1]; data/lsof-4.93.2+dfsg/dialects/osr/dsock.c:352:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[32], *cp; data/lsof-4.93.2+dfsg/dialects/sun/ddev.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 buf[MAXPATHLEN*2], *cp; data/lsof-4.93.2+dfsg/dialects/sun/ddev.c:730:15: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if ((n = atoi(&buf[len])) < 0) data/lsof-4.93.2+dfsg/dialects/sun/ddev.c:887:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN*2], *cp; data/lsof-4.93.2+dfsg/dialects/sun/ddev.c:912:15: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if ((n = atoi(&buf[len])) < 0) data/lsof-4.93.2+dfsg/dialects/sun/dfile.c:399: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[128]; data/lsof-4.93.2+dfsg/dialects/sun/dfile.c:438:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN+1]; data/lsof-4.93.2+dfsg/dialects/sun/dmnt.c:128:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!(mfp = fopen(MNTTAB, "r"))) { data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:802:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char isa[256+1]; /* kernel instruction set name */ data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:806:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char kernmod[MAXPATHLEN]; /* kernel module pathname */ data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:808:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char pfn[256+1]; /* system platform name */ data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:812:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pfxkernmod[MAXPATHLEN]; /* prefixed kernel module name */ data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:925:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[1024]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:927:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tbuf[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:1241:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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/lsof-4.93.2+dfsg/dialects/sun/dnode.c:1300:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char din[DINAMEL]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:1337:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[128], *ty, ubuf[128]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:2715:30: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. print_kptr(so_ad[0], (char *)NULL, 0), data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:3906:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:3962:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:3996:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char mn[STRNML]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:4108:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:4147:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:4175:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *cp, *nm, tbuf[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:4254:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:4279:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:4304:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:4329:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:4354:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:4379:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:4408:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:4755:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:4781:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:4807:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:4832:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:4863:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32], tbuf1[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:4903:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:4929:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:4954:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:4989:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:5045:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:5073:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; /* temporary buffer */ data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:5141:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:5170:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:5457:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode1.c:76:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char d1[2]; data/lsof-4.93.2+dfsg/dialects/sun/dnode1.c:79:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char d1[4]; data/lsof-4.93.2+dfsg/dialects/sun/dnode1.c:100:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char d2[2]; data/lsof-4.93.2+dfsg/dialects/sun/dnode1.c:379:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *cp, tbuf[32]; data/lsof-4.93.2+dfsg/dialects/sun/dnode2.c:139:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[1024]; data/lsof-4.93.2+dfsg/dialects/sun/dnode2.c:190:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[1024]; data/lsof-4.93.2+dfsg/dialects/sun/dnode2.c:371:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/sun/dproc.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 zn[ZONENAME_MAX + 1]; data/lsof-4.93.2+dfsg/dialects/sun/dproc.c:605:6: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *cp, isa[1024]; data/lsof-4.93.2+dfsg/dialects/sun/dproc.c:660:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy((void *)nl, (void *)Nl, (size_t)Nll); data/lsof-4.93.2+dfsg/dialects/sun/dproc.c:1063: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 ((Kmd = open((Memory ? Memory : KMEM), O_RDONLY)) < 0) { data/lsof-4.93.2+dfsg/dialects/sun/dproc.c:1324:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[FSTYPSZ+1]; data/lsof-4.93.2+dfsg/dialects/sun/dproc.c:1760:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN]; data/lsof-4.93.2+dfsg/dialects/sun/dsock.c:383:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sbuf[128]; data/lsof-4.93.2+dfsg/dialects/sun/dsock.c:730:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32], tbuf1[32]; /* temporary buffers */ data/lsof-4.93.2+dfsg/dialects/sun/dsock.c:1200:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32]; data/lsof-4.93.2+dfsg/dialects/sun/dsock.c:1293:15: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char d1[2]; data/lsof-4.93.2+dfsg/dialects/sun/dsock.c:1294:15: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char udp_port[2]; /* port bound to this stream */ data/lsof-4.93.2+dfsg/dialects/sun/dsock.c:1295:15: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char udp_src[4]; /* source address of this stream */ data/lsof-4.93.2+dfsg/dialects/sun/dsock.c:1739:13: [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. (void) strcat(Namech, "no TCP/UDP/IP information available"); data/lsof-4.93.2+dfsg/dialects/sun/dsock.c:1761:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32], tbuf1[32]; /* print_kptr() temporary buffers */ data/lsof-4.93.2+dfsg/dialects/sun/dsock.c:1835:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32], tbuf1[32]; /* print_kptr() temporary buffers */ data/lsof-4.93.2+dfsg/dialects/sun/machine.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 pad_pad[64 - sizeof (kmutex_t)]; data/lsof-4.93.2+dfsg/lib/dvch.c:294:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN+1], *cp1, *cp2, hn[MAXPATHLEN+1]; data/lsof-4.93.2+dfsg/lib/dvch.c:646:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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/lsof-4.93.2+dfsg/lib/dvch.c:675:18: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((DCfd = open(DCpath[DCpathX], O_RDONLY, 0)) < 0) { data/lsof-4.93.2+dfsg/lib/dvch.c:727:18: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((DCfd = open(DCpath[DCpathX], O_RDWR|O_CREAT|O_EXCL, 0600)) < 0) data/lsof-4.93.2+dfsg/lib/dvch.c:777:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN*2], cbuf[64], *cp; data/lsof-4.93.2+dfsg/lib/dvch.c:906: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). if ((Ndev = atoi(&buf[len])) < 1) data/lsof-4.93.2+dfsg/lib/dvch.c:995:15: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if ((BNdev = atoi(&buf[len])) > 0) { data/lsof-4.93.2+dfsg/lib/dvch.c:1142:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN*2], *cp, *cp1; data/lsof-4.93.2+dfsg/lib/dvch.c:1167:15: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if ((n = atoi(&buf[len])) < 0) data/lsof-4.93.2+dfsg/lib/dvch.c:1273:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN*2], *cp; data/lsof-4.93.2+dfsg/lib/prfp.c: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 tbuf[32]; data/lsof-4.93.2+dfsg/lib/regex.c:185:35: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. # if !defined bzero && !defined bcopy data/lsof-4.93.2+dfsg/lib/regex.c:209:12: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. # ifndef memcpy data/lsof-4.93.2+dfsg/lib/regex.c:210:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. # define memcpy(d, s, n) (bcopy (s, d, n), (d)) data/lsof-4.93.2+dfsg/lib/regex.c:210:30: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. # define memcpy(d, s, n) (bcopy (s, d, n), (d)) data/lsof-4.93.2+dfsg/lib/regex.c:320:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char re_syntax_table[CHAR_SET_SIZE]; data/lsof-4.93.2+dfsg/lib/regex.c:384:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (destination, source, osize)) data/lsof-4.93.2+dfsg/lib/regex.c:2409:21: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[CHAR_CLASS_MAX_LENGTH + 1]; data/lsof-4.93.2+dfsg/lib/regex.c:2530:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char str[MB_LEN_MAX + 1]; data/lsof-4.93.2+dfsg/lib/regex.c:2664:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char str[128]; /* Should be large enough. */ data/lsof-4.93.2+dfsg/lib/regex.c:2711:39: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. range_start = ((const unsigned char *) str)[0]; data/lsof-4.93.2+dfsg/lib/regex.c:6284:11: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (errbuf, msg, errbuf_size - 1); data/lsof-4.93.2+dfsg/lib/regex.c:6289:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (errbuf, msg, msg_size); data/lsof-4.93.2+dfsg/lib/rnam.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 nm[NCHNAMLEN+1]; /* name */ data/lsof-4.93.2+dfsg/lib/rnam.c:198:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN]; data/lsof-4.93.2+dfsg/lib/rnch.c:239:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN]; data/lsof-4.93.2+dfsg/lib/rnmh.c:161:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nm[NCHNAMLEN + 1]; /* name */ data/lsof-4.93.2+dfsg/lib/rnmh.c:163:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nm[1]; /* variable length name */ data/lsof-4.93.2+dfsg/lib/rnmh.c:233:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN]; data/lsof-4.93.2+dfsg/lib/rnmh.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 tbuf[32]; data/lsof-4.93.2+dfsg/lib/rnmh.c:338:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nbf[MAXPATHLEN + 1]; data/lsof-4.93.2+dfsg/lib/snpf.c:288:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[64]; data/lsof-4.93.2+dfsg/lib/snpf.c:532:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char convert[20]; data/lsof-4.93.2+dfsg/lib/snpf.c:604:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char convert[20]; data/lsof-4.93.2+dfsg/lsof.h:802:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fd[FDLEN]; data/lsof-4.93.2+dfsg/lsof.h:803:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char iproto[IPROTOL]; data/lsof-4.93.2+dfsg/lsof.h:804:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char type[TYPEL]; data/lsof-4.93.2+dfsg/lsof.h:999:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char a[MAX_AF_ADDR]; /* address */ data/lsof-4.93.2+dfsg/main.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 options[128]; data/lsof-4.93.2+dfsg/main.c:134: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). while (((i = open("/dev/null", O_RDWR, 0)) >= 0) && (i < 2)) data/lsof-4.93.2+dfsg/main.c:289:26: [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). CmdLim = TaskCmdLim = atoi(GOv); data/lsof-4.93.2+dfsg/misc.c:297:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char r_arg[MAXPATHLEN+1], r_rbuf[MAXPATHLEN+1]; data/lsof-4.93.2+dfsg/misc.c:1058:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char abuf[MAXPATHLEN+1]; data/lsof-4.93.2+dfsg/misc.c:1063:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char lbuf[MAXPATHLEN+1]; data/lsof-4.93.2+dfsg/misc.c:1069:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[MAXPATHLEN+1]; data/lsof-4.93.2+dfsg/misc.c:1356: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 up[8]; data/lsof-4.93.2+dfsg/node.c:52: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 dbuf[32]; data/lsof-4.93.2+dfsg/print.c:55:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char a[MAX_AF_ADDR]; /* numeric address */ data/lsof-4.93.2+dfsg/print.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[128], *cp, *nm; data/lsof-4.93.2+dfsg/print.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 hbuf[256]; data/lsof-4.93.2+dfsg/print.c:478: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 pb[128]; data/lsof-4.93.2+dfsg/print.c:666:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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/lsof-4.93.2+dfsg/print.c:1152:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pbuf[32]; data/lsof-4.93.2+dfsg/print.c:2026:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN]; data/lsof-4.93.2+dfsg/print.c:2276: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[64]; data/lsof-4.93.2+dfsg/print.c:2338:6: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nm[LOGINML+1]; data/lsof-4.93.2+dfsg/print.c:2342: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[USERPRTL+1]; data/lsof-4.93.2+dfsg/proc.c:973:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nma[1024]; /* name addition buffer */ data/lsof-4.93.2+dfsg/proc.c:1075:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char xbuf[64]; data/lsof-4.93.2+dfsg/proc.c:1139:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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], *cp; data/lsof-4.93.2+dfsg/proc.c:1499:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nma[1024]; /* name addition buffer */ data/lsof-4.93.2+dfsg/regex.h:592:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *__restrict __string, size_t __nmatch, data/lsof-4.93.2+dfsg/tests/LTbasic.c:76:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048]; /* temporary buffer */ data/lsof-4.93.2+dfsg/tests/LTbasic.c:162:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048]; /* temporary buffer */ data/lsof-4.93.2+dfsg/tests/LTbasic.c:172:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ibuf[64]; /* inode string buffer */ data/lsof-4.93.2+dfsg/tests/LTbasic.c:180:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *opv[4]; /* option vector for ExecLsof() */ data/lsof-4.93.2+dfsg/tests/LTbasic.c:287: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). pid = (pid_t)atoi(fop->v); data/lsof-4.93.2+dfsg/tests/LTbigf.c:63:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. if ((pn = (char *)strrchr(argv[0], '/'))) data/lsof-4.93.2+dfsg/tests/LTbigf.c:103:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). #define OPENF open /* define open function */ data/lsof-4.93.2+dfsg/tests/LTbigf.c:117:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). #define OPENF open /* define open function */ data/lsof-4.93.2+dfsg/tests/LTbigf.c:131:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). #define OPENF open /* define open function */ data/lsof-4.93.2+dfsg/tests/LTbigf.c:144:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). #define OPENF open /* define open function */ data/lsof-4.93.2+dfsg/tests/LTbigf.c:161:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). #define OPENF open /* define open function */ data/lsof-4.93.2+dfsg/tests/LTbigf.c:185:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). #define OPENF open /* define open function */ data/lsof-4.93.2+dfsg/tests/LTbigf.c:198:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). #define OPENF open /* define open function */ data/lsof-4.93.2+dfsg/tests/LTbigf.c:294:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048]; /* temporary buffer */ data/lsof-4.93.2+dfsg/tests/LTbigf.c:300:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char szbuf[64]; /* size buffer */ data/lsof-4.93.2+dfsg/tests/LTbigf.c:482:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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]; /* lsof output line buffer */ data/lsof-4.93.2+dfsg/tests/LTbigf.c:484:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *opv[5]; /* option vector for lsof */ data/lsof-4.93.2+dfsg/tests/LTbigf.c:552:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048], buf1[2048]; /* temporary buffers */ data/lsof-4.93.2+dfsg/tests/LTbigf.c:563:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *opv[4]; /* option vector for ExecLsof() */ data/lsof-4.93.2+dfsg/tests/LTbigf.c:632: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). pid = (pid_t)atoi(fop->v); data/lsof-4.93.2+dfsg/tests/LTdnlc.c:110:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048]; /* temporary buffer */ data/lsof-4.93.2+dfsg/tests/LTdnlc.c:111:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cwd[MAXPATHLEN + 1]; /* CWD */ data/lsof-4.93.2+dfsg/tests/LTdnlc.c:116:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ibuf[32]; /* inode buffer */ data/lsof-4.93.2+dfsg/tests/LTdnlc.c:117:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char lsbuf[2048 + MAXPATHLEN + 1]; /* ls(1) system() command */ data/lsof-4.93.2+dfsg/tests/LTdnlc.c:293:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *opv[3]; /* option vector for ExecLsof() */ data/lsof-4.93.2+dfsg/tests/LTdnlc.c:334: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). pid = (pid_t)atoi(fop->v); data/lsof-4.93.2+dfsg/tests/LTlib.c:273:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048]; /* temporary buffer */ data/lsof-4.93.2+dfsg/tests/LTlib.c:299:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(dn, O_RDONLY, 0)) < 0) { data/lsof-4.93.2+dfsg/tests/LTlib.c:315:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(dn, O_RDONLY, 0)) < 0) { data/lsof-4.93.2+dfsg/tests/LTlib.c:435:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048]; /* temporary buffer */ data/lsof-4.93.2+dfsg/tests/LTlib.c:613:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char embf[2048]; /* error message buffer */ data/lsof-4.93.2+dfsg/tests/LTlib.c:721:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048]; /* temporary buffer */ data/lsof-4.93.2+dfsg/tests/LTlib.c:852:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048]; /* temporary buffer */ data/lsof-4.93.2+dfsg/tests/LTlib.c:955:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy((void *)vp, (void *)fsp, tlen); data/lsof-4.93.2+dfsg/tests/LTlib.c:998:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char embf[2048]; /* error message buffer */ data/lsof-4.93.2+dfsg/tests/LTlib.c:1085:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048]; /* temporary message buffer */ data/lsof-4.93.2+dfsg/tests/LTlock.c:202:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. if ((pn = (char *)strrchr(argv[0], '/'))) data/lsof-4.93.2+dfsg/tests/LTlock.c:251:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048]; /* temporary buffer */ data/lsof-4.93.2+dfsg/tests/LTlock.c:311:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((Fd = open(Path, O_RDWR|O_CREAT, 0600)) < 0) { data/lsof-4.93.2+dfsg/tests/LTlock.c:435:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048]; /* temporary buffer */ data/lsof-4.93.2+dfsg/tests/LTlock.c:526:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048]; /* temporary buffer */ data/lsof-4.93.2+dfsg/tests/LTlock.c:537:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *opv[4]; /* option vector for ExecLsof() */ data/lsof-4.93.2+dfsg/tests/LTlock.c:595: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). pid = (pid_t)atoi(fop->v); data/lsof-4.93.2+dfsg/tests/LTlock.c:709:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048]; /* temporary buffer */ data/lsof-4.93.2+dfsg/tests/LTnfs.c:96:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048]; /* temporary buffer */ data/lsof-4.93.2+dfsg/tests/LTnfs.c:100:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char szbuf[32]; /* created test file size in ASCII */ data/lsof-4.93.2+dfsg/tests/LTnfs.c:148:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((Fd = open(Path, O_RDONLY, 0400)) < 0) { data/lsof-4.93.2+dfsg/tests/LTnfs.c:171:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((Fd = open(Path, O_RDWR|O_CREAT, 0600)) < 0) { data/lsof-4.93.2+dfsg/tests/LTnfs.c:300:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048]; /* temporary buffer */ data/lsof-4.93.2+dfsg/tests/LTnfs.c:305:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ibuf[64]; /* inode number buffer */ data/lsof-4.93.2+dfsg/tests/LTnfs.c:309:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nlkbuf[32]; /* link count buffer */ data/lsof-4.93.2+dfsg/tests/LTnfs.c:311:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *opv[5]; /* option vector for ExecLsof() */ data/lsof-4.93.2+dfsg/tests/LTnfs.c:378: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). pid = (pid_t)atoi(fop->v); data/lsof-4.93.2+dfsg/tests/LTnlink.c:95:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048]; /* temporary buffer */ data/lsof-4.93.2+dfsg/tests/LTnlink.c:99:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ibuf[32]; /* inode number in ASCII */ data/lsof-4.93.2+dfsg/tests/LTnlink.c:102:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char szbuf[32]; /* file size in ASCII */ data/lsof-4.93.2+dfsg/tests/LTnlink.c:106:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char xlnk[32]; /* expected link count in ASCII */ data/lsof-4.93.2+dfsg/tests/LTnlink.c:161:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((Fd = open(Path, O_RDWR|O_CREAT, 0600)) < 0) { data/lsof-4.93.2+dfsg/tests/LTnlink.c:358:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048]; /* temporary buffer */ data/lsof-4.93.2+dfsg/tests/LTnlink.c:367:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *opv[4]; /* option vector for ExecLsof() */ data/lsof-4.93.2+dfsg/tests/LTnlink.c:420: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). pid = (pid_t)atoi(fop->v); data/lsof-4.93.2+dfsg/tests/LTsock.c:202:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048]; /* temporary buffer */ data/lsof-4.93.2+dfsg/tests/LTsock.c:207:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char hnm[MAXHOSTNAMELEN + 1]; /* this host's name */ data/lsof-4.93.2+dfsg/tests/LTsock.c:273:12: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy((void *)&Myad.sin_addr, (void *)hp->h_addr, ti); data/lsof-4.93.2+dfsg/tests/LTsock.c:340:12: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy((void *)&ba, (void *)&Myad, sizeof(ba)); data/lsof-4.93.2+dfsg/tests/LTsock.c:352:12: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy((void *)&FdPara[ti].sa, (void *)&ca, sizeof(FdPara[ti].sa)); data/lsof-4.93.2+dfsg/tests/LTsock.c:415:12: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy((void *)&FdPara[ti].sa, (void *)&aa, sizeof(FdPara[ti].sa)); data/lsof-4.93.2+dfsg/tests/LTsock.c:587:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048]; /* temporary buffer */ data/lsof-4.93.2+dfsg/tests/LTsock.c:595:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *opv[5]; /* option vector for ExecLsof() */ data/lsof-4.93.2+dfsg/tests/LTsock.c:671: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). pid = (pid_t)atoi(fop->v); data/lsof-4.93.2+dfsg/tests/LTsock.c:835:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048]; /* temporary buffer */ data/lsof-4.93.2+dfsg/tests/LTsock.c:854:12: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy((void *)&ba, (void *)&Myad, sizeof(ba)); data/lsof-4.93.2+dfsg/tests/LTszoff.c:102:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048]; /* temporary buffer */ data/lsof-4.93.2+dfsg/tests/LTszoff.c:111:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char xbuf[64]; /* expected value buffer */ data/lsof-4.93.2+dfsg/tests/LTszoff.c:162:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((Fd = open(Path, O_RDWR|O_CREAT, 0600)) < 0) { data/lsof-4.93.2+dfsg/tests/LTszoff.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[1024]; /* lsof output line buffer */ data/lsof-4.93.2+dfsg/tests/LTszoff.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 *opv[5]; /* option vector for lsof */ data/lsof-4.93.2+dfsg/tests/LTszoff.c:301:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048]; /* temporary buffer */ data/lsof-4.93.2+dfsg/tests/LTszoff.c:307:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ibuf[64]; /* inode number buffer */ data/lsof-4.93.2+dfsg/tests/LTszoff.c:312:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *opv[4]; /* option vector for ExecLsof() */ data/lsof-4.93.2+dfsg/tests/LTszoff.c:394: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). pid = (pid_t)atoi(fop->v); data/lsof-4.93.2+dfsg/tests/LTunix.c:63: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 *Path[2] = {(char *)NULL, (char *)NULL}; data/lsof-4.93.2+dfsg/tests/LTunix.c:84:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048]; /* temporary buffer */ data/lsof-4.93.2+dfsg/tests/LTunix.c:85:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cwd[MAXPATHLEN + 1]; /* CWD buffer */ data/lsof-4.93.2+dfsg/tests/LTunix.c:223:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048]; /* temporary buffer */ data/lsof-4.93.2+dfsg/tests/LTunix.c:231:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *opv[5]; /* option vector for ExecLsof() */ data/lsof-4.93.2+dfsg/tests/LTunix.c:270: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). pid = (pid_t)atoi(fop->v); data/lsof-4.93.2+dfsg/usage.c:338:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPATHLEN+1], *cp, *cp1, *cp2; data/lsof-4.93.2+dfsg/OLD/main.c:140:9: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). (void) umask(0); data/lsof-4.93.2+dfsg/OLD/main.c:798: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). if ((fmtl = strlen(cp) + 1) < 1) { data/lsof-4.93.2+dfsg/OLD/main.c:1868: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). l = (MALLOC_S)(strlen(f) + 1); data/lsof-4.93.2+dfsg/OLD/misc.c:353:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(Pipes[0], (char *)&r_fn, sizeof(r_fn)) data/lsof-4.93.2+dfsg/OLD/misc.c:355:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). || read(Pipes[0], (char *)&r_al, sizeof(int)) data/lsof-4.93.2+dfsg/OLD/misc.c:359:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). || read(Pipes[0], r_arg, r_al) != r_al data/lsof-4.93.2+dfsg/OLD/misc.c:360:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). || read(Pipes[0], (char *)&r_rbln, sizeof(r_rbln)) data/lsof-4.93.2+dfsg/OLD/misc.c:394: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). len = strlen(fp) + 1; data/lsof-4.93.2+dfsg/OLD/misc.c:401:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). || read(Pipes[2], (char *)&rv, sizeof(rv)) != sizeof(rv) data/lsof-4.93.2+dfsg/OLD/misc.c:402:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). || read(Pipes[2], (char *)&en, sizeof(en)) != sizeof(en) data/lsof-4.93.2+dfsg/OLD/misc.c:403:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). || read(Pipes[2], rbuf, rbln) != rbln) { data/lsof-4.93.2+dfsg/OLD/misc.c:602: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 ((len = (size_t)strlen(nm)) < 1) { data/lsof-4.93.2+dfsg/OLD/misc.c:939: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). len = (MALLOC_S)(src ? strlen(src) : 0); data/lsof-4.93.2+dfsg/OLD/misc.c:976: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). len1 = (MALLOC_S)((l1 >= 0) ? l1 : strlen(s1)); data/lsof-4.93.2+dfsg/OLD/misc.c:980: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). len2 = (MALLOC_S)((l2 >= 0) ? l2 : strlen(s2)); data/lsof-4.93.2+dfsg/OLD/misc.c:984: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). len3 = (MALLOC_S)((l3 >= 0) ? l3 : strlen(s3)); data/lsof-4.93.2+dfsg/OLD/misc.c:992:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(tp, s1, len1); data/lsof-4.93.2+dfsg/OLD/misc.c:996:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(tp, s2, len2); data/lsof-4.93.2+dfsg/OLD/misc.c:1000:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(tp, s3, len3); data/lsof-4.93.2+dfsg/OLD/misc.c:1104:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(tbuf, arg, len); data/lsof-4.93.2+dfsg/OLD/misc.c:1116:14: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(abuf, lbuf, llen); data/lsof-4.93.2+dfsg/OLD/misc.c:1167:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(ap, s1, llen); data/lsof-4.93.2+dfsg/OLD/misc.c:1469: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). for (sl = strlen(sp); *sp; sl -= lnc, sp += lnc) { data/lsof-4.93.2+dfsg/OLD/print.c:241: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 (r->r_name && strlen(r->r_name)) data/lsof-4.93.2+dfsg/OLD/print.c:249:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!strlen(cp)) data/lsof-4.93.2+dfsg/OLD/print.c:315:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!se->s_name || !strlen(se->s_name)) data/lsof-4.93.2+dfsg/OLD/print.c:418: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). len = strlen(hbuf); data/lsof-4.93.2+dfsg/OLD/print.c:555:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!pn || !strlen(pn)) { data/lsof-4.93.2+dfsg/OLD/print.c:762: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). if ((len = strlen(buf)) > PidColW) data/lsof-4.93.2+dfsg/OLD/print.c:774:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((len = strlen(buf)) > TidColW) data/lsof-4.93.2+dfsg/OLD/print.c:793: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 ((len = strlen(Lp->zn)) > ZoneColW) data/lsof-4.93.2+dfsg/OLD/print.c:808: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 ((len = strlen(Lp->cntx)) > CntxColW) data/lsof-4.93.2+dfsg/OLD/print.c:824:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((len = strlen(buf)) > PpidColW) data/lsof-4.93.2+dfsg/OLD/print.c:838:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((len = strlen(buf)) > PgidColW) data/lsof-4.93.2+dfsg/OLD/print.c:847: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). if ((len = strlen(printuid((UID_ARG)Lp->uid, NULL))) > UserColW) data/lsof-4.93.2+dfsg/OLD/print.c:862: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). if ((len = strlen(buf)) > FdColW) data/lsof-4.93.2+dfsg/OLD/print.c:874: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). if ((len = strlen(Lf->type)) > TypeColW) data/lsof-4.93.2+dfsg/OLD/print.c:892: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 ((len = strlen(cp)) > FsColW) data/lsof-4.93.2+dfsg/OLD/print.c:908: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 ((len = strlen(cp)) > FcColW) data/lsof-4.93.2+dfsg/OLD/print.c:922: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 ((len = strlen(cp)) > FgColW) data/lsof-4.93.2+dfsg/OLD/print.c:934: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 ((len = strlen(cp)) > NiColW) data/lsof-4.93.2+dfsg/OLD/print.c:970:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(cp); data/lsof-4.93.2+dfsg/OLD/print.c:972: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(Lf->dev_ch); data/lsof-4.93.2+dfsg/OLD/print.c:1000:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(cp); data/lsof-4.93.2+dfsg/OLD/print.c:1010:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(cp); data/lsof-4.93.2+dfsg/OLD/print.c:1020: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). len = strlen(cp); data/lsof-4.93.2+dfsg/OLD/print.c:1045: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 (OffDecDig && (int)strlen(cp) > (OffDecDig + 2)) { data/lsof-4.93.2+dfsg/OLD/print.c:1069:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((len = strlen(cp)) > NlColW) data/lsof-4.93.2+dfsg/OLD/print.c:1102: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). if ((len = strlen(cp)) > NodeColW) data/lsof-4.93.2+dfsg/OLD/print.c:1242:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((len = strlen(host)) > nl) data/lsof-4.93.2+dfsg/OLD/print.c:1254: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). if (((len = strlen(port)) + 1) >= nl) data/lsof-4.93.2+dfsg/OLD/print.c:1277: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). CmdColW = strlen(CMDTTL); data/lsof-4.93.2+dfsg/OLD/print.c:1278: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). DevColW = strlen(DEVTTL); data/lsof-4.93.2+dfsg/OLD/print.c:1279: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). FdColW = strlen(FDTTL); data/lsof-4.93.2+dfsg/OLD/print.c:1281: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). NlColW = strlen(NLTTL); data/lsof-4.93.2+dfsg/OLD/print.c:1282: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). NmColW = strlen(NMTTL); data/lsof-4.93.2+dfsg/OLD/print.c:1283: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). NodeColW = strlen(NODETTL); data/lsof-4.93.2+dfsg/OLD/print.c:1284: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). PgidColW = strlen(PGIDTTL); data/lsof-4.93.2+dfsg/OLD/print.c:1285: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). PidColW = strlen(PIDTTL); data/lsof-4.93.2+dfsg/OLD/print.c:1286: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). PpidColW = strlen(PPIDTTL); data/lsof-4.93.2+dfsg/OLD/print.c:1288: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). SzOffColW = strlen(SZTTL); data/lsof-4.93.2+dfsg/OLD/print.c:1290: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). SzOffColW = strlen(OFFTTL); data/lsof-4.93.2+dfsg/OLD/print.c:1292: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). SzOffColW = strlen(SZOFFTTL); data/lsof-4.93.2+dfsg/OLD/print.c:1296: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). TidColW = strlen(TIDTTL); data/lsof-4.93.2+dfsg/OLD/print.c:1299: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). TypeColW = strlen(TYPETTL); data/lsof-4.93.2+dfsg/OLD/print.c:1300: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). UserColW = strlen(USERTTL); data/lsof-4.93.2+dfsg/OLD/print.c:1305: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). FsColW = strlen(FSTTL); data/lsof-4.93.2+dfsg/OLD/print.c:1309: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). FcColW = strlen(FCTTL); data/lsof-4.93.2+dfsg/OLD/print.c:1313: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). FgColW = strlen(FGTTL); data/lsof-4.93.2+dfsg/OLD/print.c:1317: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). NiColW = strlen(NiTtl); data/lsof-4.93.2+dfsg/OLD/print.c:1323: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). CntxColW = strlen(CNTXTTL); data/lsof-4.93.2+dfsg/OLD/print.c:1328: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). ZoneColW = strlen(ZONETTL); data/lsof-4.93.2+dfsg/OLD/print.c:2400:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(upn->nm, pw->pw_name, LOGINML); data/lsof-4.93.2+dfsg/OLD/print.c:2804:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!(al = strlen(pn))) { data/lsof-4.93.2+dfsg/OLD/proc.c:56: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). nl = (int) strlen(Lf->nma); data/lsof-4.93.2+dfsg/OLD/proc.c:70:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(&Lf->nma[nl + 1], cp, len); data/lsof-4.93.2+dfsg/OLD/proc.c:73:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(Lf->nma, cp, len); data/lsof-4.93.2+dfsg/OLD/proc.c:212:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(Lf->fd, nm, FDLEN - 1); data/lsof-4.93.2+dfsg/OLD/proc.c:995: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). (void) add_nma(nma, strlen(nma)); data/lsof-4.93.2+dfsg/OLD/proc.c:1030: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). (void) add_nma(nma, strlen(nma)); data/lsof-4.93.2+dfsg/OLD/proc.c:1084: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). al = (int)strlen(tp->nm) + sepl; data/lsof-4.93.2+dfsg/OLD/proc.c:1098: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). al = (int)strlen(xbuf) + sepl; data/lsof-4.93.2+dfsg/OLD/proc.c:1327:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(cp); data/lsof-4.93.2+dfsg/arg.c:169: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). j = k = strlen(path); data/lsof-4.93.2+dfsg/arg.c:182:14: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(ap, path, k); data/lsof-4.93.2+dfsg/arg.c:414: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). pfsnl = strlen(Mtprocfs->dir); data/lsof-4.93.2+dfsg/arg.c:563: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(c)) { data/lsof-4.93.2+dfsg/arg.c:683:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(xp, xb, xl); data/lsof-4.93.2+dfsg/arg.c:768: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). for (i = (int)strlen(path); (i > 1) && (path[i - 1] == '/'); i--) { data/lsof-4.93.2+dfsg/arg.c:810:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!f || (strlen(f) + 1) < 2) { data/lsof-4.93.2+dfsg/arg.c:1073: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). dnl = strlen(dn); data/lsof-4.93.2+dfsg/arg.c:1112: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). dnamlen = (MALLOC_S)strlen(dp->d_name); data/lsof-4.93.2+dfsg/arg.c:1137:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(fp + dnl + sl, dp->d_name, dnamlen); data/lsof-4.93.2+dfsg/arg.c:1709:14: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(sn, p, l); data/lsof-4.93.2+dfsg/arg.c:1847: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(s)) { data/lsof-4.93.2+dfsg/dialects/aix/ddev.c:148: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). len = (int)(1 + strlen(ttl) + 1 + strlen(dp->name) + 1); data/lsof-4.93.2+dfsg/dialects/aix/ddev.c:148: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). len = (int)(1 + strlen(ttl) + 1 + strlen(dp->name) + 1); data/lsof-4.93.2+dfsg/dialects/aix/ddev.c:592: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). (void) crc(buf, strlen(buf), &DCcksum); data/lsof-4.93.2+dfsg/dialects/aix/ddev.c:593: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). len = strlen("clone section: "); data/lsof-4.93.2+dfsg/dialects/aix/ddev.c:610: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). (void) crc(buf, strlen(buf), &DCcksum); data/lsof-4.93.2+dfsg/dialects/aix/ddev.c:645:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((len = strlen(++cp)) < 2 || *(cp + len - 1) != '\n') { data/lsof-4.93.2+dfsg/dialects/aix/dnode.c:467: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). nx = (int) strlen(Namech); data/lsof-4.93.2+dfsg/dialects/aix/dnode.c:500: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). || !(ml = (int) strlen(mn)) data/lsof-4.93.2+dfsg/dialects/aix/dproc.c:297:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). br = read(p[0], buf, sizeof(buf) - 1); data/lsof-4.93.2+dfsg/dialects/aix/dproc.c:991: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(buf); data/lsof-4.93.2+dfsg/dialects/aix/dproc.c:1000: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(buf)) data/lsof-4.93.2+dfsg/dialects/aix/dproc.c:1160:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). br = read(Kd, buf, len); data/lsof-4.93.2+dfsg/dialects/aix/dproc.c:1385: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). if ((sz = strlen(buf)) >= bufl) data/lsof-4.93.2+dfsg/dialects/aix/dproc.c:1403:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(pp, dp->d_name, dp->d_namlen); data/lsof-4.93.2+dfsg/dialects/darwin/kmem/dmnt.c:211: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). if ((len = strlen(m.m_stat.f_fstypename))) { data/lsof-4.93.2+dfsg/dialects/darwin/kmem/dnode.c:235: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 (!(cbl = (size_t)strlen(cb))) { data/lsof-4.93.2+dfsg/dialects/darwin/kmem/dnode.c:1032: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 ((rl = (int)strlen(&buf[n])) < 32) { data/lsof-4.93.2+dfsg/dialects/darwin/kmem/dproc.c:521:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). br = read(Kd, buf, len); data/lsof-4.93.2+dfsg/dialects/darwin/libproc/ddev.c:164: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). len = (int)(1 + strlen(ttl) + 1 + strlen(dp->name) + 1); data/lsof-4.93.2+dfsg/dialects/darwin/libproc/ddev.c:164: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). len = (int)(1 + strlen(ttl) + 1 + strlen(dp->name) + 1); data/lsof-4.93.2+dfsg/dialects/du/ddev.c:163: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). len = (int)(1 + strlen(ttl) + 1 + strlen(dp->name) + 1); data/lsof-4.93.2+dfsg/dialects/du/ddev.c:163: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). len = (int)(1 + strlen(ttl) + 1 + strlen(dp->name) + 1); data/lsof-4.93.2+dfsg/dialects/du/dproc.c:576:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(&buf[1]); data/lsof-4.93.2+dfsg/dialects/du/dproc.c:635:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). br = read(Kd, buf, len); data/lsof-4.93.2+dfsg/dialects/du/dproc.c:1261: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). || !Lf->fsdir || (len = strlen(Lf->fsdir)) < 1) data/lsof-4.93.2+dfsg/dialects/du/dproc.c:1263: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 ((len + 1 + strlen(cp) + 1) > sizeof(buf)) data/lsof-4.93.2+dfsg/dialects/du/dproc.c:1573:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(cp, nc->nc_name, nl); data/lsof-4.93.2+dfsg/dialects/du/dproc.c:1600:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(cp - nl, nc->nc_name, nl); data/lsof-4.93.2+dfsg/dialects/freebsd/dmnt.c:442: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). if ((len = strlen(m.m_stat.f_fstypename))) { data/lsof-4.93.2+dfsg/dialects/freebsd/dnode.c:755: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). (void) add_nma(np, (int)strlen(np)); data/lsof-4.93.2+dfsg/dialects/freebsd/dproc.c:611: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). bfl = (MALLOC_S)(strlen(bf) + 1); data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dfile.c:242: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). if ((len = strlen(mn)) < 1) data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dnode.c:69: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(b) < 1) data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dproc.c:345:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). || read(Swap, u, U_SIZE) != U_SIZE) data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dproc.c:715:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). br = read(Kd, buf, len); data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dproc.c:735:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). br = read(Mem, buf, len); data/lsof-4.93.2+dfsg/dialects/hpux/kmem/dsock.c:698: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(Namech)) { data/lsof-4.93.2+dfsg/dialects/hpux/pstat/dfile.c:346: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). if (!(nl = (int)strlen(mp[i].psr_name))) data/lsof-4.93.2+dfsg/dialects/hpux/pstat/dfile.c:554: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). nl = (int)strlen(pc); data/lsof-4.93.2+dfsg/dialects/hpux/pstat/dfile.c:582:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy((cp - nl), pc, nl); data/lsof-4.93.2+dfsg/dialects/hpux/pstat/dsock.c:1275:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(buf) + 1; data/lsof-4.93.2+dfsg/dialects/hpux/pstat/dsock.c:1332: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). len = strlen(buf) + 1; data/lsof-4.93.2+dfsg/dialects/hpux/pstat/dsock.c:1572: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). ncx = strlen(Namech); data/lsof-4.93.2+dfsg/dialects/hpux/pstat/dsock.c:1586: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). if (!(nl = strlen(s[i].val.module.pst_name))) data/lsof-4.93.2+dfsg/dialects/linux/dmnt.c:105: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 (!(ol = (int)strlen(os))) data/lsof-4.93.2+dfsg/dialects/linux/dmnt.c:267:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(path, buf, sz); data/lsof-4.93.2+dfsg/dialects/linux/dmnt.c:402: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). if (!(l = strlen(dn))) data/lsof-4.93.2+dfsg/dialects/linux/dmnt.c:526: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). dnl = strlen(dn); data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:223: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). pidx = strlen(PROCFS) + 1; data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:239: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). (void) set_net_paths(path, strlen(path)); data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:338:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(cmdbuf, cmd, sizeof(cmdbuf) - 1); data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:547: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). ll = strlen(src); data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:654: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). sl = strlen(sf); data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:696: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). len = (int) strlen(path); data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:738: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). (void) add_nma(nmabuf, strlen(nmabuf)); data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:952: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). (void) add_nma(nmabuf, strlen(nmabuf)); data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:974: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). (void) add_nma(nmabuf, strlen(nmabuf)); data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:1000: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). (void) add_nma(nmabuf, strlen(nmabuf)); data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:1021: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). (void) add_nma(nmabuf, strlen(nmabuf)); data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:1048: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). (void) add_nma(nmabuf, strlen(nmabuf)); data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:1073: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). (void) add_nma(nmabuf, strlen(nmabuf)); data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:1152: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). (void) add_nma(nmabuf, strlen(nmabuf)); data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:1170: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). (void) add_nma(nmabuf, strlen(nmabuf)); data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:1205: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). (void) add_nma(nmabuf, strlen(nmabuf)); data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:1211: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). (void) add_nma(nmabuf, strlen(nmabuf)); data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:1326: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 (((ds = (int)strlen(fp[6])) > 10) data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:1431: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). (void) add_nma(nmabuf, strlen(nmabuf)); data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:1456: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). (void) add_nma(nmabuf, strlen(nmabuf)); data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:1466: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). (void) add_nma(nmabuf, strlen(nmabuf)); data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:1498: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). (void) add_nma(nmabuf, strlen(nmabuf)); data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:1579:13: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((ch = fgetc(fs)) == EOF) data/lsof-4.93.2+dfsg/dialects/linux/dproc.c:1669: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). sz = strlen(p); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:724: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). else if ((len = strlen(fp[3]))) { data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:739: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). else if ((len = strlen(fp[2]))) { data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:754: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). else if ((len = strlen(fp[1]))) { data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1054: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). len = (int)strlen(nma); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1056: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). (void) add_nma(nma, strlen(nma)); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1071: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). (void) add_nma(nma, strlen(nma)); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1271: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). if (!fp[1] || !*fp[1] || (lal = strlen(fp[1])) < 1) { data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1283: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). if (!fp[2] || !*fp[2] || (ral = strlen(fp[2])) < 1) { data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1429: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). else if ((len = strlen(fp[0]))) { data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1444: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). else if ((len = strlen(fp[1]))) { data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1559:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!fp[1] || !*fp[1] || (strlen(fp[1])) < 1) data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1666:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!fp[2] || !*fp[2] || (strlen(fp[2])) < 1) data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1670:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!fp[3] || !*fp[3] || (strlen(fp[3]) < 1) data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1783: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). if (!fp[1] || !*fp[1] || (lal = strlen(fp[1])) < 1) { data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1795: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). if (!fp[2] || !*fp[2] || (ral = strlen(fp[2])) < 1) { data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1807: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). if (!fp[3] || !*fp[3] || (spl = strlen(fp[3])) < 1) { data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1972: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 (fp[0] && *fp[0] && (len = strlen(fp[0]))) { data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:1975: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). plen = strlen(a); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2002: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 (!i && fp[6] && *fp[6] && (len = strlen(fp[6]))) { data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2005: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). plen = strlen(id); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2033: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 (fp[j] && *fp[j] && (len = strlen(fp[j]))) { data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2036: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). plen = strlen(lp); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2063: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 (!i && fp[12] && *fp[12] && (len = strlen(fp[12]))) { data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2066: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). plen = strlen(rp); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2095: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 (fp[j] && *fp[j] && (len = strlen(fp[j]))) { data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2104: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). len = strlen(ta); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2105: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). plen = strlen(la); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2124:48: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!i && x && fp[x+1] && *fp[x+1] && (len = strlen(fp[x+1]))) { data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2133: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). len = strlen(ta); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2134: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). plen = strlen(ra); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2190:51: [1] (buffer) strlen: Does not handle 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 ((i >= nf) || !fp[i] || !*fp[i] || !(tl = strlen(fp[i]))) data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2206:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(al ? (cp + al) : cp, fp[i], tl); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2478: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). if (!fp[1] || !*fp[1] || (lal = strlen(fp[1])) < 1) { data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2490: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). if (!fp[2] || !*fp[2] || (ral = strlen(fp[2])) < 1) { data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2502: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). if (!fp[3] || !*fp[3] || (spl = strlen(fp[3])) < 1) { data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2822: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(fp[0]) + 2; data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2831:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (nf >= 8 && fp[7] && *fp[7] && (len = strlen(fp[7]))) { data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2930: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). for (i = 0, len = strlen(as); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2934:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(buf, as, 8); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2960:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!(la = strlen(a)) || !(lb = strlen(b))) data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:2960:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!(la = strlen(a)) || !(lb = strlen(b))) data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:3001: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). pl = strlen(pbuf); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:3005: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). pl = strlen(pbuf); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:3011: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). pl = strlen(pbuf); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:3015: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). pl = strlen(pbuf); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:3023: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). pl = strlen(pbuf); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:3050: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). pl = strlen(pbuf); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:3272: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(ip->la); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:3275:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(cp, ip->la, len); data/lsof-4.93.2+dfsg/dialects/linux/dsock.c:4346: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). i = (int)strlen(Namech); data/lsof-4.93.2+dfsg/dialects/n+obsd/dnode.c:439: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). ktnl = strlen(ktnm); data/lsof-4.93.2+dfsg/dialects/n+obsd/dnode.c:440:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (ktnl > (MAXPATHLEN - strlen(_PATH_KERNFS) - 2)) { data/lsof-4.93.2+dfsg/dialects/n+obsd/dnode.c:441: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). ktnl = MAXPATHLEN - strlen(_PATH_KERNFS) - 2; data/lsof-4.93.2+dfsg/dialects/n+obsd/dproc.c:464: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). bfl = (MALLOC_S)(strlen(bf) + 1); data/lsof-4.93.2+dfsg/dialects/n+os/dproc.c:420:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). br = read(Kd, buf, len); data/lsof-4.93.2+dfsg/dialects/osr/dmnt.c:79:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). br = read(fd, (char *)&m, bx); data/lsof-4.93.2+dfsg/dialects/osr/dmnt.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). dvnml = strlen(m.mt_dev); data/lsof-4.93.2+dfsg/dialects/osr/dmnt.c:93:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(dvnm, m.mt_dev, dvnml); data/lsof-4.93.2+dfsg/dialects/osr/dmnt.c:95: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). fsnml = strlen(m.mt_filsys); data/lsof-4.93.2+dfsg/dialects/osr/dmnt.c:98:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(fsnm, m.mt_filsys, fsnml); data/lsof-4.93.2+dfsg/dialects/osr/dmnt.c:101:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((br = read(fd, (char *)&m, bx)) == bx data/lsof-4.93.2+dfsg/dialects/osr/dmnt.c:108: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(&m.mt_dev[8]); data/lsof-4.93.2+dfsg/dialects/osr/dmnt.c:112:14: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(&dvnm[dvnml], &m.mt_dev[8], len); data/lsof-4.93.2+dfsg/dialects/osr/dmnt.c:116: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(&m.mt_filsys[8]); data/lsof-4.93.2+dfsg/dialects/osr/dmnt.c:120:14: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(&fsnm[fsnml], &m.mt_filsys[8], len); data/lsof-4.93.2+dfsg/dialects/osr/dnode.c:322: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(Namech); data/lsof-4.93.2+dfsg/dialects/osr/dnode.c:326: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). k += strlen(dp->name); data/lsof-4.93.2+dfsg/dialects/osr/dnode.c:333: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). k += strlen(cp); data/lsof-4.93.2+dfsg/dialects/osr/dnode.c:358:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((l = strlen(tbuf)) < 1) data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:358: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). len = strlen(buf) + 1; data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:582: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). len = strlen("KERNEL="); data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:618: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(dir[i]) + strlen(de->d_name) + 1; data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:618: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). len = strlen(dir[i]) + strlen(de->d_name) + 1; data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:639: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). len = (MALLOC_S)(strlen(pp) + 1); data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:737:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((br = read(Kd, buf, len)) < 0) data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:925: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). len = strlen(buf) + 1; data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:1191:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(nm, cp->name, DNLC_NAMELEN); data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:1192:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((len = strlen(nm)) < 1) data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:1275:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(nm, cp->dn_name, DTNCMAX); data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:1276: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). if ((len = strlen(nm)) < 1) data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:1356:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(nm, cp->name, DIRSIZ); data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:1357: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). if ((len = strlen(nm)) < 1) data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:1433:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(lc->nm, nm, nl); data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:1684:14: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy((cp - nl), lc->nm, nl); data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:1732:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy((cp - nl), lc->nm, nl); data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:1821:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(nm, cp->name, len); data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:1823: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). if ((len = strlen(nm)) < 1) data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:1980:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(nm, cp->name, DIRSIZ); data/lsof-4.93.2+dfsg/dialects/osr/dproc.c:1981: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). if ((len = strlen(nm)) < 1) data/lsof-4.93.2+dfsg/dialects/osr/dsock.c:376: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). cp = &buf[strlen(buf)]; data/lsof-4.93.2+dfsg/dialects/osr/dsock.c:412: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). len = (MALLOC_S)(strlen(buf) + 1); data/lsof-4.93.2+dfsg/dialects/sun/ddev.c:164: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). len = (int)(1 + strlen(ttl) + 1 + strlen(dp->name) + 1); data/lsof-4.93.2+dfsg/dialects/sun/ddev.c:164: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). len = (int)(1 + strlen(ttl) + 1 + strlen(dp->name) + 1); data/lsof-4.93.2+dfsg/dialects/sun/ddev.c:726: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). (void) crc(buf, strlen(buf), &DCcksum); data/lsof-4.93.2+dfsg/dialects/sun/ddev.c:727: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). len = strlen("clone section: "); data/lsof-4.93.2+dfsg/dialects/sun/ddev.c:744: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). (void) crc(buf, strlen(buf), &DCcksum); data/lsof-4.93.2+dfsg/dialects/sun/ddev.c:803:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((len = strlen(++cp)) < 2 || *(cp + len - 1) != '\n') { data/lsof-4.93.2+dfsg/dialects/sun/ddev.c:908: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). (void) crc(buf, strlen(buf), &DCcksum); data/lsof-4.93.2+dfsg/dialects/sun/ddev.c:909: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). len = strlen("pseudo section: "); data/lsof-4.93.2+dfsg/dialects/sun/ddev.c:926: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). (void) crc(buf, strlen(buf), &DCcksum); data/lsof-4.93.2+dfsg/dialects/sun/ddev.c:976:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((len = strlen(++cp)) < 2 || *(cp + len - 1) != '\n') { data/lsof-4.93.2+dfsg/dialects/sun/dmnt.c:84:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(s->st_fstype, f, sizeof(s->st_fstype)); data/lsof-4.93.2+dfsg/dialects/sun/dmnt.c:124: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). devl = strlen(MNTOPT_DEV); data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:839:12: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(kernmod, t, sizeof(kernmod) - 1); data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:953: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). *len = (int)strlen(buf); data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:1004: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). for (i = n = 0, pfl = (int)strlen(pf); (i < Ndev) && (n < NTCPUDP); i++) data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:1266: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). (void) add_nma(buf, (int)strlen(buf)); data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:1800: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). tbufx = (int)strlen(tbuf); data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:1808: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). tbufx = (int)strlen(tbuf); data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:1814: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). tbufx = (int)strlen(tbuf); data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:1898: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). (void) add_nma(SAMFS_NMA_MSG, (int)strlen(SAMFS_NMA_MSG)); data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:2126: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). (void) add_nma(SAMFS_NMA_MSG, (int)strlen(SAMFS_NMA_MSG)); data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:2423: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). tl = strlen(nm); data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:2434: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). sepl = strlen(sep); data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:2438: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). tl = strlen(nm); data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:2460: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). tl = strlen(nm); data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:2476: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). tl = strlen(nm); data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:2488: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). tl = strlen(nm); data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:2508: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). tl = strlen(nm); data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:2525: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). tl = strlen(nm); data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:2585: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). nl = snl = (int)strlen(Namech); data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:2645: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). len = (int)strlen(ubuf); data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:2671: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). len = (int)strlen(ubuf); data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:2684: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). len = (int)strlen(ubuf); data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:2726: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). malloc((int)strlen(ubuf) + 1))) data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:2728: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). (void) snpf(Lf->nma, (int)strlen(ubuf) + 1, "%s", ubuf); data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:2760: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). len = (int)strlen(ua.sun_path); data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:2761: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). nl = (int)strlen(Namech); data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:3041: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). nl = Lf->nma ? (int)strlen(Lf->nma) : 0; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:3045: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). len = nl + (int)strlen(ubuf) + 1; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:3820: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). len = (int)strlen("(COMMON)") + 1; data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:4031: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). k = (int)strlen(Namech); data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:4050: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 ((j = (int)strlen(mn)) < 1) data/lsof-4.93.2+dfsg/dialects/sun/dnode.c:5030: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). return((int)strlen(ua->sun_path)); data/lsof-4.93.2+dfsg/dialects/sun/dnode2.c:144: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). nl = (MALLOC_S)strlen(msg); data/lsof-4.93.2+dfsg/dialects/sun/dnode2.c:146: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). al = (MALLOC_S)strlen(EMSGPFX) + nl + 1; data/lsof-4.93.2+dfsg/dialects/sun/dnode2.c:150: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). if (!(eml = (MALLOC_S)strlen(em))) { data/lsof-4.93.2+dfsg/dialects/sun/dproc.c:620: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). if (strncmp(cp, ARCH64B, strlen(ARCH64B)) == 0) { data/lsof-4.93.2+dfsg/dialects/sun/dproc.c:873: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). if (!(l = strlen(zn))) data/lsof-4.93.2+dfsg/dialects/sun/dproc.c:1009:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((br = (int)read(Kmd, (void *)bp, (size_t)b2r)) <= 0) data/lsof-4.93.2+dfsg/dialects/sun/dproc.c:1350: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). len = strlen(buf) + 1; data/lsof-4.93.2+dfsg/dialects/sun/dproc.c:1795: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). || !Lf->fsdir || (len = strlen(Lf->fsdir)) < 1) data/lsof-4.93.2+dfsg/dialects/sun/dproc.c:1797: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 ((len + 1 + strlen(cp) + 1) > sizeof(buf)) data/lsof-4.93.2+dfsg/dialects/sun/dproc.c:2052:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(cp, nc->name, len); data/lsof-4.93.2+dfsg/dialects/sun/dproc.c:2233:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy((cp - nl), lc->nm, nl); data/lsof-4.93.2+dfsg/dialects/sun/dsock.c:1099:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. (void) strncpy(Lf->iproto, "ROUTE", IPROTOL - 1); data/lsof-4.93.2+dfsg/lib/dvch.c:331: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 ((cp1 = getenv(HASENVDC)) && (l = strlen(cp1)) > 0 data/lsof-4.93.2+dfsg/lib/dvch.c:435: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). if ((i + (l = strlen(p->pw_dir))) >= (int)sizeof(buf)) { data/lsof-4.93.2+dfsg/lib/dvch.c:473: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). j = strlen(hn); data/lsof-4.93.2+dfsg/lib/dvch.c:496:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). && (l = strlen(cp2)) > 0 data/lsof-4.93.2+dfsg/lib/dvch.c:553: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). if ((i + (l = strlen(p->pw_name))) >= (int)sizeof(buf)) { data/lsof-4.93.2+dfsg/lib/dvch.c:567: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). if ((i + (l = strlen(hn))) >= (int)sizeof(buf)) data/lsof-4.93.2+dfsg/lib/dvch.c:844: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). (void) crc(buf, strlen(buf), &DCcksum); data/lsof-4.93.2+dfsg/lib/dvch.c:864:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(cbuf); data/lsof-4.93.2+dfsg/lib/dvch.c:890: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). (void) crc(buf, strlen(buf), &DCcksum); data/lsof-4.93.2+dfsg/lib/dvch.c:891:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen("device section: "); data/lsof-4.93.2+dfsg/lib/dvch.c:921: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). (void) crc(buf, strlen(buf), &DCcksum); data/lsof-4.93.2+dfsg/lib/dvch.c:955: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). if ((len = strlen(++cp)) < 2 || *(cp + len - 1) != '\n') { data/lsof-4.93.2+dfsg/lib/dvch.c:981: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). (void) crc(buf, strlen(buf), &DCcksum); data/lsof-4.93.2+dfsg/lib/dvch.c:982:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen("block device section: "); data/lsof-4.93.2+dfsg/lib/dvch.c:1009: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). (void) crc(buf, strlen(buf), &DCcksum); data/lsof-4.93.2+dfsg/lib/dvch.c:1043:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((len = strlen(++cp)) < 2 || *(cp + len - 1) != '\n') { data/lsof-4.93.2+dfsg/lib/dvch.c:1163: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). (void) crc(buf, strlen(buf), &DCcksum); data/lsof-4.93.2+dfsg/lib/dvch.c:1164: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). len = strlen("clone section: "); data/lsof-4.93.2+dfsg/lib/dvch.c:1182: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). (void) crc(buf, strlen(buf), &DCcksum); data/lsof-4.93.2+dfsg/lib/dvch.c:1392: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). bl = strlen(b); data/lsof-4.93.2+dfsg/lib/pdvn.c:155: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). len = (int)(1 + strlen(ttl) + 1 + strlen(dp->name) + 1); data/lsof-4.93.2+dfsg/lib/pdvn.c:155: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). len = (int)(1 + strlen(ttl) + 1 + strlen(dp->name) + 1); data/lsof-4.93.2+dfsg/lib/rdev.c:209: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). dnamlen = (int)strlen(dp->d_name); data/lsof-4.93.2+dfsg/lib/regex.c:6033: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). ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf); data/lsof-4.93.2+dfsg/lib/regex.c:6050: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). const int len = strlen (s); data/lsof-4.93.2+dfsg/lib/regex.c:6147: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). ret = regex_compile (pattern, strlen (pattern), syntax, preg); data/lsof-4.93.2+dfsg/lib/regex.c:6198:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen (string); data/lsof-4.93.2+dfsg/lib/regex.c:6275: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). msg_size = strlen (msg) + 1; /* Includes the null. */ data/lsof-4.93.2+dfsg/lib/rnam.c:233: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). || !Lf->fsdir || (len = strlen(Lf->fsdir)) < 1) data/lsof-4.93.2+dfsg/lib/rnam.c:235: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 ((len + 1 + strlen(cp) + 1) > sizeof(buf)) data/lsof-4.93.2+dfsg/lib/rnam.c:465:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(lc->nm, kc->NCACHE_NM, len); data/lsof-4.93.2+dfsg/lib/rnam.c:467: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). lc->nl = strlen(lc->nm); data/lsof-4.93.2+dfsg/lib/rnam.c:660:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy((cp - nl), lc->nm, nl); data/lsof-4.93.2+dfsg/lib/rnch.c:274: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). || !Lf->fsdir || (len = strlen(Lf->fsdir)) < 1) data/lsof-4.93.2+dfsg/lib/rnch.c:276: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 ((len + 1 + strlen(cp) + 1) > sizeof(buf)) data/lsof-4.93.2+dfsg/lib/rnch.c:564:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(cp, np, len); data/lsof-4.93.2+dfsg/lib/rnch.c:803:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy((cp - nl), lc->nm, nl); data/lsof-4.93.2+dfsg/lib/rnmh.c:268: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). || !Lf->fsdir || (len = strlen(Lf->fsdir)) < 1) data/lsof-4.93.2+dfsg/lib/rnmh.c:270: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 ((len + 1 + strlen(cp) + 1) > sizeof(buf)) data/lsof-4.93.2+dfsg/lib/rnmh.c:465: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). if ((len = (int)strlen(nbf)) < 4) { data/lsof-4.93.2+dfsg/lib/rnmh.c:479: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). rl = (int)strlen(np); data/lsof-4.93.2+dfsg/lib/rnmh.c:521:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(lc->nm, c.NCACHE_NM, len); data/lsof-4.93.2+dfsg/lib/rnmh.c:545:11: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(lc->nm, c.NCACHE_NM, cin); data/lsof-4.93.2+dfsg/lib/rnmh.c:553:14: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(lc->nm, c.NCACHE_NM, len); data/lsof-4.93.2+dfsg/lib/rnmh.c:555:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(lc->nm, nbf, len); data/lsof-4.93.2+dfsg/lib/rnmh.c:735:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy((cp - nl), lc->nm, nl); data/lsof-4.93.2+dfsg/lib/snpf.c:367:11: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. (void) strncpy(ebuf, "ll is unsupported", ebufl); data/lsof-4.93.2+dfsg/lib/snpf.c:388:11: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. (void) strncpy(ebuf, "ll is unsupported", ebufl); data/lsof-4.93.2+dfsg/lib/snpf.c:409:11: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. (void) strncpy(ebuf, "ll is unsupported", ebufl); data/lsof-4.93.2+dfsg/lib/snpf.c:434:11: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. (void) strncpy(ebuf, "ll is unsupported", ebufl); data/lsof-4.93.2+dfsg/lib/snpf.c:464:11: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. (void) strncpy(ebuf, "ll is unsupported", ebufl); data/lsof-4.93.2+dfsg/lib/snpf.c:500:14: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. (void) strncpy(&ebuf[1], " is unsupported", ebufl); data/lsof-4.93.2+dfsg/lib/snpf.c:672:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int padlen, strlen; /* amount to pad */ data/lsof-4.93.2+dfsg/lib/snpf.c:676: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). for (strlen = 0; value[strlen]; ++ strlen) /* strlen() */ data/lsof-4.93.2+dfsg/lib/snpf.c:676: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). for (strlen = 0; value[strlen]; ++ strlen) /* strlen() */ data/lsof-4.93.2+dfsg/lib/snpf.c:678: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 > maxwidth) && maxwidth) data/lsof-4.93.2+dfsg/lib/snpf.c:680: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). padlen = len - strlen; data/lsof-4.93.2+dfsg/main.c:140:9: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). (void) umask(0); data/lsof-4.93.2+dfsg/main.c:798: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). if ((fmtl = strlen(cp) + 1) < 1) { data/lsof-4.93.2+dfsg/main.c:1905: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). l = (MALLOC_S)(strlen(f) + 1); data/lsof-4.93.2+dfsg/misc.c:353:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(Pipes[0], (char *)&r_fn, sizeof(r_fn)) data/lsof-4.93.2+dfsg/misc.c:355:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). || read(Pipes[0], (char *)&r_al, sizeof(int)) data/lsof-4.93.2+dfsg/misc.c:359:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). || read(Pipes[0], r_arg, r_al) != r_al data/lsof-4.93.2+dfsg/misc.c:360:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). || read(Pipes[0], (char *)&r_rbln, sizeof(r_rbln)) data/lsof-4.93.2+dfsg/misc.c:394: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). len = strlen(fp) + 1; data/lsof-4.93.2+dfsg/misc.c:401:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). || read(Pipes[2], (char *)&rv, sizeof(rv)) != sizeof(rv) data/lsof-4.93.2+dfsg/misc.c:402:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). || read(Pipes[2], (char *)&en, sizeof(en)) != sizeof(en) data/lsof-4.93.2+dfsg/misc.c:403:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). || read(Pipes[2], rbuf, rbln) != rbln) { data/lsof-4.93.2+dfsg/misc.c:602: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 ((len = (size_t)strlen(nm)) < 1) { data/lsof-4.93.2+dfsg/misc.c:939: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). len = (MALLOC_S)(src ? strlen(src) : 0); data/lsof-4.93.2+dfsg/misc.c:976: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). len1 = (MALLOC_S)((l1 >= 0) ? l1 : strlen(s1)); data/lsof-4.93.2+dfsg/misc.c:980: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). len2 = (MALLOC_S)((l2 >= 0) ? l2 : strlen(s2)); data/lsof-4.93.2+dfsg/misc.c:984: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). len3 = (MALLOC_S)((l3 >= 0) ? l3 : strlen(s3)); data/lsof-4.93.2+dfsg/misc.c:992:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(tp, s1, len1); data/lsof-4.93.2+dfsg/misc.c:996:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(tp, s2, len2); data/lsof-4.93.2+dfsg/misc.c:1000:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(tp, s3, len3); data/lsof-4.93.2+dfsg/misc.c:1104:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(tbuf, arg, len); data/lsof-4.93.2+dfsg/misc.c:1116:14: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(abuf, lbuf, llen); data/lsof-4.93.2+dfsg/misc.c:1167:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(ap, s1, llen); data/lsof-4.93.2+dfsg/misc.c:1471: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). for (sl = strlen(sp); *sp; sl -= lnc, sp += lnc) { data/lsof-4.93.2+dfsg/print.c:241: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 (r->r_name && strlen(r->r_name)) data/lsof-4.93.2+dfsg/print.c:249:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!strlen(cp)) data/lsof-4.93.2+dfsg/print.c:315:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!se->s_name || !strlen(se->s_name)) data/lsof-4.93.2+dfsg/print.c:418: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). len = strlen(hbuf); data/lsof-4.93.2+dfsg/print.c:555:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!pn || !strlen(pn)) { data/lsof-4.93.2+dfsg/print.c:764: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). if ((len = strlen(buf)) > PidColW) data/lsof-4.93.2+dfsg/print.c:784:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((len = strlen(buf)) >TaskTidColW) data/lsof-4.93.2+dfsg/print.c:810: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 ((len = strlen(Lp->zn)) > ZoneColW) data/lsof-4.93.2+dfsg/print.c:825: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 ((len = strlen(Lp->cntx)) > CntxColW) data/lsof-4.93.2+dfsg/print.c:841:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((len = strlen(buf)) > PpidColW) data/lsof-4.93.2+dfsg/print.c:855:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((len = strlen(buf)) > PgidColW) data/lsof-4.93.2+dfsg/print.c:864: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). if ((len = strlen(printuid((UID_ARG)Lp->uid, NULL))) > UserColW) data/lsof-4.93.2+dfsg/print.c:879: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). if ((len = strlen(buf)) > FdColW) data/lsof-4.93.2+dfsg/print.c:891: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). if ((len = strlen(Lf->type)) > TypeColW) data/lsof-4.93.2+dfsg/print.c:909: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 ((len = strlen(cp)) > FsColW) data/lsof-4.93.2+dfsg/print.c:925: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 ((len = strlen(cp)) > FcColW) data/lsof-4.93.2+dfsg/print.c:939: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 ((len = strlen(cp)) > FgColW) data/lsof-4.93.2+dfsg/print.c:951: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 ((len = strlen(cp)) > NiColW) data/lsof-4.93.2+dfsg/print.c:987:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(cp); data/lsof-4.93.2+dfsg/print.c:989: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(Lf->dev_ch); data/lsof-4.93.2+dfsg/print.c:1017:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(cp); data/lsof-4.93.2+dfsg/print.c:1027:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(cp); data/lsof-4.93.2+dfsg/print.c:1037: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). len = strlen(cp); data/lsof-4.93.2+dfsg/print.c:1062: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 (OffDecDig && (int)strlen(cp) > (OffDecDig + 2)) { data/lsof-4.93.2+dfsg/print.c:1086:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((len = strlen(cp)) > NlColW) data/lsof-4.93.2+dfsg/print.c:1119: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). if ((len = strlen(cp)) > NodeColW) data/lsof-4.93.2+dfsg/print.c:1259:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((len = strlen(host)) > nl) data/lsof-4.93.2+dfsg/print.c:1271: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). if (((len = strlen(port)) + 1) >= nl) data/lsof-4.93.2+dfsg/print.c:1303: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). CmdColW = strlen(CMDTTL); data/lsof-4.93.2+dfsg/print.c:1304: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). DevColW = strlen(DEVTTL); data/lsof-4.93.2+dfsg/print.c:1305: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). FdColW = strlen(FDTTL); data/lsof-4.93.2+dfsg/print.c:1307: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). NlColW = strlen(NLTTL); data/lsof-4.93.2+dfsg/print.c:1308: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). NmColW = strlen(NMTTL); data/lsof-4.93.2+dfsg/print.c:1309: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). NodeColW = strlen(NODETTL); data/lsof-4.93.2+dfsg/print.c:1310: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). PgidColW = strlen(PGIDTTL); data/lsof-4.93.2+dfsg/print.c:1311: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). PidColW = strlen(PIDTTL); data/lsof-4.93.2+dfsg/print.c:1312: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). PpidColW = strlen(PPIDTTL); data/lsof-4.93.2+dfsg/print.c:1314: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). SzOffColW = strlen(SZTTL); data/lsof-4.93.2+dfsg/print.c:1316: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). SzOffColW = strlen(OFFTTL); data/lsof-4.93.2+dfsg/print.c:1318: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). SzOffColW = strlen(SZOFFTTL); data/lsof-4.93.2+dfsg/print.c:1321: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). TaskCmdColW = strlen(TASKCMDTTL); data/lsof-4.93.2+dfsg/print.c:1322: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). TaskTidColW = strlen(TASKTIDTTL); data/lsof-4.93.2+dfsg/print.c:1325: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). TypeColW = strlen(TYPETTL); data/lsof-4.93.2+dfsg/print.c:1326: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). UserColW = strlen(USERTTL); data/lsof-4.93.2+dfsg/print.c:1331: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). FsColW = strlen(FSTTL); data/lsof-4.93.2+dfsg/print.c:1335: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). FcColW = strlen(FCTTL); data/lsof-4.93.2+dfsg/print.c:1339: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). FgColW = strlen(FGTTL); data/lsof-4.93.2+dfsg/print.c:1343: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). NiColW = strlen(NiTtl); data/lsof-4.93.2+dfsg/print.c:1349: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). CntxColW = strlen(CNTXTTL); data/lsof-4.93.2+dfsg/print.c:1354: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). ZoneColW = strlen(ZONETTL); data/lsof-4.93.2+dfsg/print.c:2426:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(upn->nm, pw->pw_name, LOGINML); data/lsof-4.93.2+dfsg/print.c:2830:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!(al = strlen(pn))) { data/lsof-4.93.2+dfsg/proc.c:60: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). nl = (int) strlen(Lf->nma); data/lsof-4.93.2+dfsg/proc.c:74:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(&Lf->nma[nl + 1], cp, len); data/lsof-4.93.2+dfsg/proc.c:77:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(Lf->nma, cp, len); data/lsof-4.93.2+dfsg/proc.c:216:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(Lf->fd, nm, FDLEN - 1); data/lsof-4.93.2+dfsg/proc.c:1011: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). (void) add_nma(nma, strlen(nma)); data/lsof-4.93.2+dfsg/proc.c:1046: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). (void) add_nma(nma, strlen(nma)); data/lsof-4.93.2+dfsg/proc.c:1100: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). al = (int)strlen(tp->nm) + sepl; data/lsof-4.93.2+dfsg/proc.c:1114: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). al = (int)strlen(xbuf) + sepl; data/lsof-4.93.2+dfsg/proc.c:1343:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(cp); data/lsof-4.93.2+dfsg/proc.c:1517: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). (void) add_nma(nma, strlen(nma)); data/lsof-4.93.2+dfsg/tests/LTlib.c:376: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 (((tlen = (int)strlen(dp)) < 1) || (tlen > XDINDEV)) data/lsof-4.93.2+dfsg/tests/LTlib.c:761: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). srclen = (int)strlen(src); data/lsof-4.93.2+dfsg/tests/LTlib.c:798: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). pfxlen = (int)(strlen(pn)); data/lsof-4.93.2+dfsg/tests/LTlib.c:799: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). pfxlen += (int)strlen(" ... "); data/lsof-4.93.2+dfsg/tests/LTlib.c:1096: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 (((xl = (int)strlen(wx)) < 1) || (xl > XDINDEV)) { data/lsof-4.93.2+dfsg/tests/LTsock.c:882:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). br = read(fd, buf, bufl); data/lsof-4.93.2+dfsg/tests/LTunix.c:132:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((strlen(cwd) + strlen("/config.LT#U9223372036854775807") + 1) data/lsof-4.93.2+dfsg/tests/LTunix.c:132: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 ((strlen(cwd) + strlen("/config.LT#U9223372036854775807") + 1) data/lsof-4.93.2+dfsg/tests/LTunix.c:135:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(cwd, "/tmp", sizeof(cwd) - 1); data/lsof-4.93.2+dfsg/tests/LTunix.c:173:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(ua.sun_path, Path[ti], sizeof(ua.sun_path)); data/lsof-4.93.2+dfsg/tests/LTunix.c:336: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). nl = strlen(Path[tj]); ANALYSIS SUMMARY: Hits = 979 Lines analyzed = 118773 in approximately 2.99 seconds (39686 lines/second) Physical Source Lines of Code (SLOC) = 75924 Hits@level = [0] 1913 [1] 466 [2] 393 [3] 9 [4] 106 [5] 5 Hits@level+ = [0+] 2892 [1+] 979 [2+] 513 [3+] 120 [4+] 111 [5+] 5 Hits/KSLOC@level+ = [0+] 38.0907 [1+] 12.8945 [2+] 6.75676 [3+] 1.58053 [4+] 1.46199 [5+] 0.0658553 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.