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/adns-1.6.0/regress/hnonfuzz.c Examining data/adns-1.6.0/regress/hfuzz.c Examining data/adns-1.6.0/client/adnshost.h Examining data/adns-1.6.0/client/fanftest.c Examining data/adns-1.6.0/client/adh-opts.c Examining data/adns-1.6.0/client/adh-query.c Examining data/adns-1.6.0/client/adh-main.c Examining data/adns-1.6.0/client/adnsresfilter.c Examining data/adns-1.6.0/client/addrtext.c Examining data/adns-1.6.0/client/client.h Examining data/adns-1.6.0/client/adnslogres.c Examining data/adns-1.6.0/client/adnstest.c Examining data/adns-1.6.0/client/adnsheloex.c Examining data/adns-1.6.0/acconfig.h Examining data/adns-1.6.0/src/check.c Examining data/adns-1.6.0/src/types.c Examining data/adns-1.6.0/src/query.c Examining data/adns-1.6.0/src/reply.c Examining data/adns-1.6.0/src/event.c Examining data/adns-1.6.0/src/parse.c Examining data/adns-1.6.0/src/transmit.c Examining data/adns-1.6.0/src/general.c Examining data/adns-1.6.0/src/internal.h Examining data/adns-1.6.0/src/poll.c Examining data/adns-1.6.0/src/adns.h Examining data/adns-1.6.0/src/tvarith.h Examining data/adns-1.6.0/src/addrfam.c Examining data/adns-1.6.0/src/setup.c Examining data/adns-1.6.0/src/dlist.h FINAL RESULTS: data/adns-1.6.0/acconfig.h:75:34: [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 ATTRPRINTF(si,tc) format(printf,si,tc) data/adns-1.6.0/client/adh-main.c:52:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr,fmt,al); data/adns-1.6.0/client/adh-main.c:73:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(p,str); data/adns-1.6.0/client/adh-query.c:137:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(qun->owner, "%s %s", arg,arg2); data/adns-1.6.0/client/adnsheloex.c:79:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, al); data/adns-1.6.0/client/adnsheloex.c:108:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(line->start, buf); data/adns-1.6.0/client/adnslogres.c:79:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, al); data/adns-1.6.0/client/adnslogres.c:152:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(line->start, buf); data/adns-1.6.0/client/adnsresfilter.c:277:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(newbuf, bracket ? "%s%.*s" : "%s[%.*s]", name, entry->textlen, entry->textp); data/adns-1.6.0/src/addrfam.c:234:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr,fmt,al); data/adns-1.6.0/src/addrfam.c:532:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(p, zone); data/adns-1.6.0/src/setup.c:705:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(logfndata,fmt,al); data/adns-1.6.0/client/adnsheloex.c:256:14: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c= getopt(argc, argv, "c:C:dp")) != -1) data/adns-1.6.0/client/adnslogres.c:263:14: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c= getopt(argc, argv, "c:C:dp")) != -1) data/adns-1.6.0/regress/hnonfuzz.c:41:22: [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. const char *fdstr= getenv("ADNS_TEST_IN_FD"); data/adns-1.6.0/regress/hnonfuzz.c:71: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. mfavar= getenv("ADNS_REGRESS_MALLOCFAILAT"); data/adns-1.6.0/src/setup.c:542:10: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. value= getenv(envvar); data/adns-1.6.0/src/types.c:1574:16: [3] (random) nrand48: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. randval= nrand48(ads->rand48xsubi); data/adns-1.6.0/client/addrtext.c:106: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 ourbuf[ADNS_ADDR2TEXT_BUFLEN]; data/adns-1.6.0/client/addrtext.c:107: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 theirbuf[ADNS_ADDR2TEXT_BUFLEN]; data/adns-1.6.0/client/adh-query.c:59:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[12]; data/adns-1.6.0/client/adh-query.c:66:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf,"TYPE%d", (int)(type & adns_rrt_typemask)); data/adns-1.6.0/client/adh-query.c:73: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 idbuf[20]; data/adns-1.6.0/client/adh-query.c:83:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(idbuf,"%lu",idcounter++); data/adns-1.6.0/client/adnsheloex.c:98:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[MAXLINE]; data/adns-1.6.0/client/adnsheloex.c:259: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). maxpending= atoi(optarg); data/adns-1.6.0/client/adnsheloex.c:285:10: [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). inf= fopen(*argv, "r"); data/adns-1.6.0/client/adnslogres.c:95:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[30]; /* "123.123.123.123.in-addr.arpa.\0" */ data/adns-1.6.0/client/adnslogres.c:96: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 *ptrs[5]; data/adns-1.6.0/client/adnslogres.c:103:7: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "invalid."); data/adns-1.6.0/client/adnslogres.c:117:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf, "%.*s.%.*s.%.*s.%.*s.in-addr.arpa.", data/adns-1.6.0/client/adnslogres.c:142:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[MAXLINE]; data/adns-1.6.0/client/adnslogres.c:266: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). maxpending= atoi(optarg); data/adns-1.6.0/client/adnslogres.c:292:10: [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). inf= fopen(*argv, "r"); data/adns-1.6.0/client/adnsresfilter.c:70: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 addrtextbuf[18]; /* [ddd.ddd.ddd.ddd] + nul */ data/adns-1.6.0/client/adnsresfilter.c:72:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static unsigned char bytes[4]; data/adns-1.6.0/client/adnsresfilter.c:76: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. unsigned char bytes[4]; data/adns-1.6.0/client/adnsresfilter.c:323:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(newthing->bytes,bytes,4); data/adns-1.6.0/client/adnsresfilter.c:330:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&sa.sin_addr,bytes,4); data/adns-1.6.0/client/adnsresfilter.c:338:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(entry->textp,addrtextbuf,inbuf); data/adns-1.6.0/client/adnsresfilter.c:354: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 readbuf[512], *p; data/adns-1.6.0/client/adnstest.c:182: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 ownflags[10]; data/adns-1.6.0/regress/hfuzz.c:116:13: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). t_stdin = tmpfile(); data/adns-1.6.0/regress/hnonfuzz.c:33:59: [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). FILE *Hfopen(const char *path, const char *mode) { return fopen(path,mode); } data/adns-1.6.0/regress/hnonfuzz.c:43:10: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). return atoi(fdstr); data/adns-1.6.0/regress/hnonfuzz.c:102: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. if (osz) memcpy(np,op, osz>nsz ? nsz : osz); data/adns-1.6.0/src/addrfam.c:271: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 copybuf[INET6_ADDRSTRLEN]; data/adns-1.6.0/src/addrfam.c:303:7: [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(copybuf, text, lhslen); data/adns-1.6.0/src/addrfam.c:515:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. p += sprintf(p, "%d", (int)(aa & 0xff)); data/adns-1.6.0/src/adns.h:373: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 *(array[2]); data/adns-1.6.0/src/event.c:365: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 addrbuf[ADNS_ADDR2TEXT_BUFLEN]; data/adns-1.6.0/src/general.c:53:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[ADNS_ADDR2TEXT_BUFLEN]; data/adns-1.6.0/src/general.c:140:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(vb->buf+vb->used,data,len); data/adns-1.6.0/src/general.c:350:7: [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(tempbuf, data + i*sz, sz); data/adns-1.6.0/src/general.c:352:7: [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(data + place*sz, tempbuf, sz); data/adns-1.6.0/src/parse.c:30: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 qbuf[10]; data/adns-1.6.0/src/parse.c:38:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(qbuf,"\\%03o",ch); data/adns-1.6.0/src/parse.c:41:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(qbuf,"\\%c",ch); data/adns-1.6.0/src/poll.c:76:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(fds,fds_tmp,sizeof(struct pollfd)*found); data/adns-1.6.0/src/query.c:106:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(qu->query_dgram,qu->vb.buf,qu->vb.used); data/adns-1.6.0/src/query.c:258:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ans->owner,owner,ol); data/adns-1.6.0/src/query.c:345: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 shortbuf[100]; data/adns-1.6.0/src/query.c:669:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(after,before,l); data/adns-1.6.0/src/query.c:679:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(after,before,sz); data/adns-1.6.0/src/reply.c:221:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(qu->cname_dgram,dgram,dglen); data/adns-1.6.0/src/reply.c:223:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(qu->answer->cname,qu->vb.buf,l); data/adns-1.6.0/src/reply.c:392:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(newquery,qu->vb.buf,qu->vb.used); data/adns-1.6.0/src/setup.c:47:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[ADNS_ADDR2TEXT_BUFLEN]; data/adns-1.6.0/src/setup.c:66:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&ss->addr, sa, salen); data/adns-1.6.0/src/setup.c:114: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 addrbuf[ADNS_ADDR2TEXT_BUFLEN]; data/adns-1.6.0/src/setup.c:166:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(newchars,word,l); data/adns-1.6.0/src/setup.c:191: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 tbuf[200], *slash, *ep; data/adns-1.6.0/src/setup.c:212:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tbuf,word,l); tbuf[l]= 0; data/adns-1.6.0/src/setup.c:494:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf,cp,l); data/adns-1.6.0/src/setup.c:508: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 linebuf[2000], *p, *q; data/adns-1.6.0/src/setup.c:552: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). gl_ctx.file= fopen(filename,"r"); data/adns-1.6.0/src/transmit.c:139:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(rqp,label,ll); rqp+= ll; data/adns-1.6.0/src/transmit.c:169:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(rqp,qd_dgram+labstart,lablen); data/adns-1.6.0/src/types.c:116:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(str,dgram+cbyte,l); data/adns-1.6.0/src/types.c:127:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[10]; data/adns-1.6.0/src/types.c:140:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf,"\\x%02x",ch); data/adns-1.6.0/src/types.c:260:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(storeto, pai->dgram + cbyte, 4); data/adns-1.6.0/src/types.c:306:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[ADNS_ADDR2TEXT_BUFLEN]; data/adns-1.6.0/src/types.c:332:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(storeto->s6_addr, pai->dgram + cbyte, 16); data/adns-1.6.0/src/types.c:424:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(v6map.s6_addr + 12, use_addr, 4); data/adns-1.6.0/src/types.c:479:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[ADNS_ADDR2TEXT_BUFLEN]; data/adns-1.6.0/src/types.c:495:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf,"AF=%u",rrp->addr.sa.sa_family); data/adns-1.6.0/src/types.c:620:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, *dp, drrsz); data/adns-1.6.0/src/types.c:623:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p + drrsz, sp, srrsz); data/adns-1.6.0/src/types.c:638:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(pans->cname, cans->cname, n); data/adns-1.6.0/src/types.c:777:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dm,pai->qu->vb.buf,pai->qu->vb.used); data/adns-1.6.0/src/types.c:1009:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[20]; data/adns-1.6.0/src/types.c:1018:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf," %d ",rrp->astatus); data/adns-1.6.0/src/types.c:1116:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[10]; data/adns-1.6.0/src/types.c:1122:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf,"%u ",i); data/adns-1.6.0/src/types.c:1329:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(str,vb->buf,vb->used); data/adns-1.6.0/src/types.c:1415:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[20]; data/adns-1.6.0/src/types.c:1426:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf," %lu",(&rrp->serial)[i]); data/adns-1.6.0/src/types.c:1513:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[30]; data/adns-1.6.0/src/types.c:1518:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf,"%u %u %u ", rrp->priority, rrp->weight, rrp->port); data/adns-1.6.0/src/types.c:1588:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&rrtmp, workbegin, rrsz); data/adns-1.6.0/src/types.c:1589:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(workbegin, search, rrsz); data/adns-1.6.0/src/types.c:1590:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(search, &rrtmp, rrsz); data/adns-1.6.0/src/types.c:1623:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(rrp->data, pai->dgram + cbyte, rrp->len); data/adns-1.6.0/src/types.c:1629:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[10]; data/adns-1.6.0/src/types.c:1636:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf,"\\# %d",rrp->len); data/adns-1.6.0/src/types.c:1642:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf," %02x%02x%02x%02x",p[0],p[1],p[2],p[3]); data/adns-1.6.0/src/types.c:1648:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf," %02x",*p); data/adns-1.6.0/client/adh-main.c:72: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). p= xmalloc(strlen(str)+1); data/adns-1.6.0/client/adh-main.c:117: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(arg) > 4 && !memcmp(arg,"type",4) && data/adns-1.6.0/client/adh-main.c:212:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r= read(0,buf+used,avail-used); data/adns-1.6.0/client/adh-opts.c:157:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (oip->sopt) { l= strlen(oip->sopt); if (l>maxsopt) maxsopt= l; } data/adns-1.6.0/client/adh-opts.c:159:5: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). l= strlen(oip->lopt); data/adns-1.6.0/client/adh-opts.c:204: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). (strlen(oip->sopt) + strlen(oip->lopt) + 2*strlen(oip->argdesc))); data/adns-1.6.0/client/adh-opts.c:204: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). (strlen(oip->sopt) + strlen(oip->lopt) + 2*strlen(oip->argdesc))); data/adns-1.6.0/client/adh-opts.c:204: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). (strlen(oip->sopt) + strlen(oip->lopt) + 2*strlen(oip->argdesc))); data/adns-1.6.0/client/adh-opts.c:211: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). (strlen(oip->lopt) + strlen(oip->argdesc))); data/adns-1.6.0/client/adh-opts.c:211: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). (strlen(oip->lopt) + strlen(oip->argdesc))); data/adns-1.6.0/client/adh-opts.c:221: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). (strlen(oip->lopt) + strlen(oip->argdesc) + strlen(oip->argdesc2))); data/adns-1.6.0/client/adh-opts.c:221: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). (strlen(oip->lopt) + strlen(oip->argdesc) + strlen(oip->argdesc2))); data/adns-1.6.0/client/adh-opts.c:221:50: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). (strlen(oip->lopt) + strlen(oip->argdesc) + strlen(oip->argdesc2))); data/adns-1.6.0/client/adh-opts.c:314:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). l= strlen(sopt); data/adns-1.6.0/client/adh-query.c:136: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). qun->owner= xmalloc(strlen(arg) + strlen(arg2) + 2); data/adns-1.6.0/client/adh-query.c:136: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). qun->owner= xmalloc(strlen(arg) + strlen(arg2) + 2); data/adns-1.6.0/client/adnsheloex.c:103: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). str= malloc(sizeof(*line) + strlen(buf) + 1); data/adns-1.6.0/client/adnsheloex.c:188: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). ok |= !strncmp(addr, head->addr, strlen(addr)); data/adns-1.6.0/client/adnslogres.c:147: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). str= malloc(sizeof(*line) + strlen(buf) + 1); data/adns-1.6.0/client/adnsresfilter.c:268: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). namelen= strlen(name); data/adns-1.6.0/client/adnsresfilter.c:357:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((r= read(0,readbuf,sizeof(readbuf))) <= 0) { data/adns-1.6.0/client/adnstest.c:166:35: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return strspn(string,accept) == strlen(string); data/adns-1.6.0/regress/hfuzz.c:78:11: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = getchar(); data/adns-1.6.0/regress/hfuzz.c:119:13: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = getchar(); data/adns-1.6.0/src/addrfam.c:428: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). int scopeoffset = strlen(buffer); data/adns-1.6.0/src/addrfam.c:503: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). req += strlen(zone) + 1; data/adns-1.6.0/src/addrfam.c:559: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 (!adns__labels_equal(p,l, want,strlen(want))) return 0; data/adns-1.6.0/src/event.c:402:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r= read(ads->tcpsocket, data/adns-1.6.0/src/event.c:484:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r= read(ads->tcpsocket,ads->tcprecv.buf,1); data/adns-1.6.0/src/general.c:164:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). l= strlen(data); data/adns-1.6.0/src/general.c:225:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert(strlen(vb.buf) == vb.used-1); data/adns-1.6.0/src/parse.c:46: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). !adns__vbuf_append(vb,qbuf,strlen(qbuf))) data/adns-1.6.0/src/query.c:297: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). ol= strlen(owner); data/adns-1.6.0/src/query.c:667:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). l= strlen(before)+1; data/adns-1.6.0/src/reply.c:213:5: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). l= strlen(qu->vb.buf)+1; data/adns-1.6.0/src/setup.c:447:8: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c= getc(file); data/adns-1.6.0/src/setup.c:473:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c= getc(file)) != EOF && c != '\n'); data/adns-1.6.0/src/setup.c:526: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). !(strlen(ccip->name)==dirl && !memcmp(ccip->name,p,q-p)); data/adns-1.6.0/src/types.c:634: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). size_t n= strlen(cans->cname) + 1; data/adns-1.6.0/src/types.c:686: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). strlen(pans->cname), &tinfo_addrsub, data/adns-1.6.0/src/types.c:1025: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). st= csp_qstring(vb,errstr,strlen(errstr)); if (st) return st; ANALYSIS SUMMARY: Hits = 149 Lines analyzed = 11820 in approximately 0.38 seconds (30824 lines/second) Physical Source Lines of Code (SLOC) = 7977 Hits@level = [0] 84 [1] 41 [2] 90 [3] 6 [4] 12 [5] 0 Hits@level+ = [0+] 233 [1+] 149 [2+] 108 [3+] 18 [4+] 12 [5+] 0 Hits/KSLOC@level+ = [0+] 29.209 [1+] 18.6787 [2+] 13.5389 [3+] 2.25649 [4+] 1.50432 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.