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/sdop-0.90/src/debug.c Examining data/sdop-0.90/src/sys.c Examining data/sdop-0.90/src/hyphen.c Examining data/sdop-0.90/src/buildhy.c Examining data/sdop-0.90/src/globals.h Examining data/sdop-0.90/src/globals.c Examining data/sdop-0.90/src/mytypes.h Examining data/sdop-0.90/src/ucp.h Examining data/sdop-0.90/src/footnote.c Examining data/sdop-0.90/src/toc.c Examining data/sdop-0.90/src/datatables.c Examining data/sdop-0.90/src/font.c Examining data/sdop-0.90/src/functions.h Examining data/sdop-0.90/src/number.c Examining data/sdop-0.90/src/jpeg.c Examining data/sdop-0.90/src/para.c Examining data/sdop-0.90/src/preface.c Examining data/sdop-0.90/src/ref.c Examining data/sdop-0.90/src/write.c Examining data/sdop-0.90/src/url.c Examining data/sdop-0.90/src/table.c Examining data/sdop-0.90/src/revision.c Examining data/sdop-0.90/src/read.c Examining data/sdop-0.90/src/hytest.c Examining data/sdop-0.90/src/misc.c Examining data/sdop-0.90/src/page.c Examining data/sdop-0.90/src/utf8tables.c Examining data/sdop-0.90/src/sdop.h Examining data/sdop-0.90/src/sdop.c Examining data/sdop-0.90/src/error.c Examining data/sdop-0.90/src/index.c Examining data/sdop-0.90/src/book.c Examining data/sdop-0.90/src/entity.c Examining data/sdop-0.90/src/pin.c Examining data/sdop-0.90/src/tree.c Examining data/sdop-0.90/src/object.c Examining data/sdop-0.90/src/ucd.c Examining data/sdop-0.90/src/hyphen.h Examining data/sdop-0.90/src/structs.h Examining data/sdop-0.90/src/png.c FINAL RESULTS: data/sdop-0.90/src/mytypes.h:57:28: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. #define Uchmod(s,n) chmod(CCS(s),n) data/sdop-0.90/src/mytypes.h:58:28: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. #define Uchown(s,n,m) chown(CCS(s),n,m) data/sdop-0.90/src/debug.c:32:7: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void)vfprintf(stderr, format, ap); data/sdop-0.90/src/error.c:231:9: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void)vfprintf(stderr, error_data[n].text, ap); data/sdop-0.90/src/font.c:157:1: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(CS line, "fontmetrics/%s.afm", af->name); data/sdop-0.90/src/font.c:160:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(CS line, "%s.afm", af->name); data/sdop-0.90/src/font.c:685:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(CS namebuffer, "%s%s", famname, fs->suffixes[vf->type]); data/sdop-0.90/src/hytest.c:120:9: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. if (sscanf(CS line+offset, "%s%n", word, &len) <= 0) break; data/sdop-0.90/src/index.c:449:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(CS buffer, "%s%d", prefix, spage); data/sdop-0.90/src/index.c:457:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(CS buffer, "%s%d", S_EN_DASH, epage); data/sdop-0.90/src/index.c:772:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(CS buffer, data/sdop-0.90/src/index.c:901:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(CS buffer, data/sdop-0.90/src/misc.c:84:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(CS buffer, "%s/%s", s, name); data/sdop-0.90/src/misc.c:90:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(CS buffer, "%s/%s", DATADIR, name); data/sdop-0.90/src/mytypes.h:22:48: [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_FUNCTION __attribute__((format(printf,1,2))) data/sdop-0.90/src/mytypes.h:72:28: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). #define Ustrcat(s,t) strcat(CS(s),CCS(t)) data/sdop-0.90/src/mytypes.h:77:28: [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). #define Ustrcpy(s,t) strcpy(CS(s),CCS(t)) data/sdop-0.90/src/number.c:87:15: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(CS buffer, "%s. ", p->value); data/sdop-0.90/src/number.c:91:15: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(CS buffer, "%s ", p->value); data/sdop-0.90/src/number.c:127:13: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. (void)sprintf(CS ffbuff, CS figure_number_format, fnbuff); data/sdop-0.90/src/number.c:131:13: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. (void)sprintf(CS ffbuff, CS figure_number_format, fnbuff); data/sdop-0.90/src/number.c:135:13: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. (void)sprintf(CS ffbuff, CS figure_number_format, chapter_number, fnbuff); data/sdop-0.90/src/number.c:146:11: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. (void)sprintf(CS buffer, CS figure_title_format, ffbuff); data/sdop-0.90/src/number.c:174:13: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. (void)sprintf(CS ffbuff, CS table_number_format, fnbuff); data/sdop-0.90/src/number.c:178:13: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. (void)sprintf(CS ffbuff, CS table_number_format, fnbuff); data/sdop-0.90/src/number.c:182:13: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. (void)sprintf(CS ffbuff, CS table_number_format, chapter_number, fnbuff); data/sdop-0.90/src/number.c:193:11: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. (void)sprintf(CS buffer, CS table_title_format, ffbuff); data/sdop-0.90/src/number.c:221:13: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. (void)sprintf(CS ffbuff, CS example_number_format, fnbuff); data/sdop-0.90/src/number.c:225:13: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. (void)sprintf(CS ffbuff, CS example_number_format, fnbuff); data/sdop-0.90/src/number.c:229:13: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. (void)sprintf(CS ffbuff, CS example_number_format, chapter_number, fnbuff); data/sdop-0.90/src/number.c:240:11: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. (void)sprintf(CS buffer, CS example_title_format, ffbuff); data/sdop-0.90/src/object.c:194:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(CS buffer, "./%s", pfile->value); data/sdop-0.90/src/object.c:199:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(CS buffer + blen, "/%s", pfile->value); data/sdop-0.90/src/page.c:1088:15: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(CS buffer, data/sdop-0.90/src/read.c:97:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(CS buffer, "+%s=%s:%s", param->name, param->value, data/sdop-0.90/src/read.c:114:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(CS buffer, "+%s:%s", param->name, new->name); data/sdop-0.90/src/read.c:536:30: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. if (insection > 0) pp += sprintf(CS pp, "%s%d", data/sdop-0.90/src/read.c:538:33: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. if (insubsection > 0) pp += sprintf(CS pp, "%s%d", data/sdop-0.90/src/ref.c:211:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(CS p->value, "%s", data/sdop-0.90/src/toc.c:247:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(CS ss, "%s%s%s%s%s%s", strings[0], strings[1], data/sdop-0.90/src/toc.c:250:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(CS ss, "%s%s%s", strings[0], s, strings[3]); data/sdop-0.90/src/toc.c:260:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(CS tt, "%s%d%s", strings[4], toc_page, strings[5]); data/sdop-0.90/src/toc.c:276:12: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. t += sprintf(CS t, "%s", value); data/sdop-0.90/src/write.c:107:9: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. yield = vfprintf(outfile, format, ap); data/sdop-0.90/src/write.c:1378:15: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. (void)sprintf(CS outbuffer, CS olist_format, buffer); data/sdop-0.90/src/write.c:2013:25: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. if (t != NULL) t += sprintf(CS t, "%s", tt); data/sdop-0.90/src/sdop.c:531:27: [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. uschar *share = (uschar *)getenv("SDOP_SHARE"); data/sdop-0.90/src/book.c:170: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(s, ii->p.txtblk->string, ii->p.txtblk->length); data/sdop-0.90/src/buildhy.c:75: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). infile = fopen(argv[1], "r"); data/sdop-0.90/src/buildhy.c:83:11: [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). outfile = fopen(argv[2], "w"); data/sdop-0.90/src/buildhy.c:91:27: [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 (argc > 3) indexsize = atoi(argv[3]); data/sdop-0.90/src/entity.c:265: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(newtb->string, tb->string, tb->length + 1); data/sdop-0.90/src/hyphen.c:60:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). hy_indexsize = atoi(CS line); data/sdop-0.90/src/hyphen.c:73:23: [2] (integer) atol: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). hy_index[i].pos = atol(CS line+4); data/sdop-0.90/src/hytest.c:61:19: [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). main_hyphenfile = fopen(argv[arg++], "r"); data/sdop-0.90/src/hytest.c:73: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). infile = fopen(argv[arg++], "r"); data/sdop-0.90/src/hytest.c:85: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). outfile = fopen(argv[arg++], "w"); data/sdop-0.90/src/index.c:619:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buffer + bp, tp, length); data/sdop-0.90/src/index.c:891: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(prevstn, stn, sizeof(stn)); /* Remember previous 3 texts */ data/sdop-0.90/src/misc.c:320: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, string, length); data/sdop-0.90/src/misc.c:637:19: [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. int offset = 40 * sprintf(CS buffer, "%d", n); data/sdop-0.90/src/misc.c:728:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. p += sprintf(CS p, "%d", n); data/sdop-0.90/src/misc.c:732:8: [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(CS p, ".%03d", d); data/sdop-0.90/src/mytypes.h:54:28: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). #define Uatoi(s) atoi(CCS(s)) data/sdop-0.90/src/mytypes.h:55:28: [2] (integer) atol: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). #define Uatol(s) atol(CCS(s)) data/sdop-0.90/src/mytypes.h:60:28: [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). #define Ufopen(s,t) fopen(CCS(s),CCS(t)) data/sdop-0.90/src/mytypes.h:65:28: [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 Uopen(s,n,m) open(CCS(s),(n)|O_BINARY,m) /* where all files must */ data/sdop-0.90/src/mytypes.h:67:28: [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 Uopen(s,n,m) open(CCS(s),n,m) /* to avoid problems */ data/sdop-0.90/src/number.c:118:11: [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. (void)sprintf(CS fnbuff, "%d", ++figure_number); data/sdop-0.90/src/number.c:165:11: [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. (void)sprintf(CS fnbuff, "%d", ++table_number); data/sdop-0.90/src/number.c:212:11: [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. (void)sprintf(CS fnbuff, "%d", ++example_number); data/sdop-0.90/src/object.c:110:45: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. (void)fprintf(outfile, "%02x", ((unsigned char *)scanline)[i]); data/sdop-0.90/src/object.c:198: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(buffer, read_filename, blen); data/sdop-0.90/src/object.c:212:9: [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. (void)sprintf(CS formname, "%.*s", (int)(sizeof(formname) - 1), dot + 1); data/sdop-0.90/src/object.c:215:9: [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. (void)sprintf(CS formname, "%.*s", (int)(sizeof(formname) - 1), pform->value); data/sdop-0.90/src/page.c:378:1: [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(tdnew->coldata, td->coldata, td->colcount * sizeof(tcolstr)); data/sdop-0.90/src/page.c:1124:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ntb, tb, sizeof(textblock) + tb->length + 1); data/sdop-0.90/src/para.c:1679: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(ntb->string, ctb->string + startoffset, length); data/sdop-0.90/src/para.c:1874: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(tbnew->string, p, len - 1); data/sdop-0.90/src/read.c:186:15: [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(t, "amp;", 4); data/sdop-0.90/src/read.c:214: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(tbnew->string, tb->string, tb->length); data/sdop-0.90/src/read.c:215: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(tbnew->string + tb->length, pp, len); data/sdop-0.90/src/read.c:237: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(tbnew->string, pp, len); data/sdop-0.90/src/read.c:534:30: [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. if (inchapter > 0) pp += sprintf(CS pp, "%d", inchapter); data/sdop-0.90/src/read.c:535:31: [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. if (inappendix > 0) pp += sprintf(CS pp, "%c", 'A' + inappendix - 1); data/sdop-0.90/src/read.c:819: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(buffer2, p, pp - p); data/sdop-0.90/src/read.c:821: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(pn, c, 8); data/sdop-0.90/src/ref.c:204: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(CS p->value, "%d", pagenumber); data/sdop-0.90/src/sdop.c:545:1: [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(number_sections, number_sections_default, data/sdop-0.90/src/toc.c:149: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(toc_printed_sections, toc_sections, sizeof(toc_sections)); data/sdop-0.90/src/toc.c:370: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(toc_sections, toc_sections_preface_default, data/sdop-0.90/src/toc.c:372: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(toc_printed_sections, toc_sections_preface_default, data/sdop-0.90/src/toc.c:382:1: [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(toc_sections, toc_sections_default, sizeof(toc_sections_default)); data/sdop-0.90/src/toc.c:383:1: [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(toc_printed_sections, toc_sections_default, data/sdop-0.90/src/toc.c:385:1: [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(number_sections, number_sections_default, data/sdop-0.90/src/url.c:102: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(s, t->string, t->length - endspacelen); data/sdop-0.90/src/url.c:107: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(s, p->value, ulen); data/sdop-0.90/src/url.c:111: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(s, t->string + t->length - endspacelen, endspacelen); data/sdop-0.90/src/write.c:536:17: [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. (void)sprintf(CS(tb->string), "%d", ++nextfn); data/sdop-0.90/src/write.c:1269:13: [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. (void)sprintf(CS buff, "XX-%d", ++overflow_page_count); data/sdop-0.90/src/write.c:1354:17: [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. (void)sprintf(CS buffer, "%d", listcount++); data/sdop-0.90/src/write.c:2233:1: [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(ilist_top_colour, ilist_tag_colour, 3*sizeof(int)); data/sdop-0.90/src/write.c:2234:1: [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(olist_top_colour, olist_tag_colour, 3*sizeof(int)); data/sdop-0.90/src/write.c:2370: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(ilist_tag_colour, ilist_top_colour, 3*sizeof(int)); data/sdop-0.90/src/write.c:2371: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(olist_tag_colour, olist_top_colour, 3*sizeof(int)); data/sdop-0.90/src/write.c:2515:11: [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. (void)sprintf(CS arabicpage, "%d", ++pagenumber); data/sdop-0.90/src/write.c:2535:9: [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. (void)sprintf(CS arabicpage, "%d", ++pagenumber); data/sdop-0.90/src/write.c:2721:9: [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. (void)sprintf(CS arabicpage, "%d", ++pagenumber); data/sdop-0.90/src/write.c:2744:9: [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. (void)sprintf(CS arabicpage, "%d", ++pagenumber); data/sdop-0.90/src/write.c:2814:11: [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. (void)sprintf(CS arabicpage, "%d", ++pagenumber); data/sdop-0.90/src/write.c:2838:9: [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. (void)sprintf(CS arabicpage, "%d", ++pagenumber); data/sdop-0.90/src/buildhy.c:96:14: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((ch = fgetc(infile)) != EOF) storefile[filesize++] = ch; data/sdop-0.90/src/mytypes.h:69:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define Uread(f,b,l) read(f,CS(b),l) data/sdop-0.90/src/mytypes.h:80: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). #define Ustrlen(s) (int)strlen(CCS(s)) data/sdop-0.90/src/mytypes.h:81:28: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. #define Ustrncat(s,t,n) strncat(CS(s),CCS(t),n) data/sdop-0.90/src/mytypes.h:83:28: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). #define Ustrncpy(s,t,n) strncpy(CS(s),CCS(t),n) ANALYSIS SUMMARY: Hits = 116 Lines analyzed = 24611 in approximately 0.82 seconds (30164 lines/second) Physical Source Lines of Code (SLOC) = 16204 Hits@level = [0] 87 [1] 5 [2] 64 [3] 1 [4] 44 [5] 2 Hits@level+ = [0+] 203 [1+] 116 [2+] 111 [3+] 47 [4+] 46 [5+] 2 Hits/KSLOC@level+ = [0+] 12.5278 [1+] 7.15873 [2+] 6.85016 [3+] 2.90052 [4+] 2.83881 [5+] 0.123426 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.