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/ruby-tioga-1.19.1/ext/Dobjects/Dtable/dtable.c Examining data/ruby-tioga-1.19.1/ext/Dobjects/Dtable/dtable_intern.h Examining data/ruby-tioga-1.19.1/ext/Dobjects/Dtable/include/dtable.h Examining data/ruby-tioga-1.19.1/ext/Dobjects/Dvector/dvector.c Examining data/ruby-tioga-1.19.1/ext/Dobjects/Dvector/dvector_intern.h Examining data/ruby-tioga-1.19.1/ext/Dobjects/Dvector/include/dvector.h Examining data/ruby-tioga-1.19.1/ext/Dobjects/Function/function.c Examining data/ruby-tioga-1.19.1/ext/Dobjects/Function/joint_qsort.c Examining data/ruby-tioga-1.19.1/ext/Flate/flate.c Examining data/ruby-tioga-1.19.1/ext/Flate/flate_intern.h Examining data/ruby-tioga-1.19.1/ext/Flate/include/flate.h Examining data/ruby-tioga-1.19.1/ext/Flate/zlib/adler32.c Examining data/ruby-tioga-1.19.1/ext/Flate/zlib/compress.c Examining data/ruby-tioga-1.19.1/ext/Flate/zlib/crc32.c Examining data/ruby-tioga-1.19.1/ext/Flate/zlib/crc32.h Examining data/ruby-tioga-1.19.1/ext/Flate/zlib/deflate.c Examining data/ruby-tioga-1.19.1/ext/Flate/zlib/deflate.h Examining data/ruby-tioga-1.19.1/ext/Flate/zlib/gzio.c Examining data/ruby-tioga-1.19.1/ext/Flate/zlib/infback.c Examining data/ruby-tioga-1.19.1/ext/Flate/zlib/inffast.c Examining data/ruby-tioga-1.19.1/ext/Flate/zlib/inffast.h Examining data/ruby-tioga-1.19.1/ext/Flate/zlib/inffixed.h Examining data/ruby-tioga-1.19.1/ext/Flate/zlib/inflate.c Examining data/ruby-tioga-1.19.1/ext/Flate/zlib/inflate.h Examining data/ruby-tioga-1.19.1/ext/Flate/zlib/inftrees.c Examining data/ruby-tioga-1.19.1/ext/Flate/zlib/inftrees.h Examining data/ruby-tioga-1.19.1/ext/Flate/zlib/trees.c Examining data/ruby-tioga-1.19.1/ext/Flate/zlib/trees.h Examining data/ruby-tioga-1.19.1/ext/Flate/zlib/uncompr.c Examining data/ruby-tioga-1.19.1/ext/Flate/zlib/zconf.h Examining data/ruby-tioga-1.19.1/ext/Flate/zlib/zlib.h Examining data/ruby-tioga-1.19.1/ext/Flate/zlib/zutil.c Examining data/ruby-tioga-1.19.1/ext/Flate/zlib/zutil.h Examining data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/figures.c Examining data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/figures.h Examining data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/generic.c Examining data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/generic.h Examining data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/init.c Examining data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/pdfs.h Examining data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/axes.c Examining data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/makers.c Examining data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdf_font_dicts.c Examining data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdfcolor.c Examining data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdfcoords.c Examining data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdffile.c Examining data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdfimage.c Examining data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdfpath.c Examining data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdftext.c Examining data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/texout.c Examining data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/wrappers.c Examining data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/wrappers.h Examining data/ruby-tioga-1.19.1/ext/includes/defs.h Examining data/ruby-tioga-1.19.1/ext/includes/namespace.h Examining data/ruby-tioga-1.19.1/ext/includes/safe_double.h Examining data/ruby-tioga-1.19.1/ext/includes/symbols.c Examining data/ruby-tioga-1.19.1/ext/includes/symbols.h Examining data/ruby-tioga-1.19.1/samples/plots/data/builder.c Examining data/ruby-tioga-1.19.1/tests/profile_Dvector/fancy_read.c Examining data/ruby-tioga-1.19.1/tests/profile_Dvector/prepare_file.c Examining data/ruby-tioga-1.19.1/tests/profile_Dvector/profile_fancy_read.c FINAL RESULTS: data/ruby-tioga-1.19.1/ext/Flate/zlib/gzio.c:131: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(s->path, path); /* do this early for debugging */ data/ruby-tioga-1.19.1/ext/Flate/zlib/gzio.c:613:11: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. (void)vsprintf(buf, format, va); data/ruby-tioga-1.19.1/ext/Flate/zlib/gzio.c:618:11: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. len = vsprintf(buf, format, va); data/ruby-tioga-1.19.1/ext/Flate/zlib/gzio.c:623:11: [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. (void)vsnprintf(buf, sizeof(buf), format, va); data/ruby-tioga-1.19.1/ext/Flate/zlib/gzio.c:627:11: [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. len = vsnprintf(buf, sizeof(buf), format, va); data/ruby-tioga-1.19.1/ext/Flate/zlib/gzio.c:650:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8, data/ruby-tioga-1.19.1/ext/Flate/zlib/gzio.c:655:11: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. len = sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8, data/ruby-tioga-1.19.1/ext/Flate/zlib/gzio.c:660:5: [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. snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8, data/ruby-tioga-1.19.1/ext/Flate/zlib/gzio.c:664:11: [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. len = snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8, data/ruby-tioga-1.19.1/ext/Flate/zlib/gzio.c:1008: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(s->msg, s->path); data/ruby-tioga-1.19.1/ext/Flate/zlib/gzio.c:1010:5: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(s->msg, m); data/ruby-tioga-1.19.1/ext/Flate/zlib/zutil.h:199:18: [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. # if !defined(vsnprintf) && !defined(NO_vsnprintf) data/ruby-tioga-1.19.1/ext/Flate/zlib/zutil.h:200:15: [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 _vsnprintf data/ruby-tioga-1.19.1/ext/Flate/zlib/zutil.h:246:39: [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. # define Trace(x) {if (z_verbose>=0) fprintf x ;} data/ruby-tioga-1.19.1/ext/Flate/zlib/zutil.h:247:39: [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. # define Tracev(x) {if (z_verbose>0) fprintf x ;} data/ruby-tioga-1.19.1/ext/Flate/zlib/zutil.h:248:40: [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. # define Tracevv(x) {if (z_verbose>1) fprintf x ;} data/ruby-tioga-1.19.1/ext/Flate/zlib/zutil.h:249:48: [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. # define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;} data/ruby-tioga-1.19.1/ext/Flate/zlib/zutil.h:250:49: [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. # define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/generic.c:123:4: [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. snprintf(buff,sizeof(buff),fmt,s); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/generic.c:129:4: [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. snprintf(buff,sizeof(buff),fmt,s1,s2); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/generic.c:135:4: [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. snprintf(buff,sizeof(buff),fmt,x); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/generic.c:141:4: [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. snprintf(buff,sizeof(buff),fmt,x1,x2); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/generic.c:147:4: [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. snprintf(buff,sizeof(buff),fmt,x); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/generic.c:153:4: [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. snprintf(buff,sizeof(buff),fmt,x1,x2); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/init.c:317:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(full_name, "%s/", save); j = strlen(full_name); } data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/axes.c:332: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. snprintf(form, sizeof(form), (s->vertical)? "\\tiogayaxisnumericlabel{%%.%df}" : "\\tiogaxaxisnumericlabel{%%.%df}", numdig); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/axes.c:333: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. snprintf(buff, sizeof(buff), form, pow_val); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/axes.c:335: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. snprintf(buff, sizeof(buff), (s->vertical)? "\\tiogayaxisnumericlabel{%0.2f}" : "\\tiogaxaxisnumericlabel{%0.2f}", pow_val); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/axes.c:337: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. snprintf(buff, sizeof(buff), (s->vertical)? "\\tiogayaxisnumericlabel{%d}" : "\\tiogaxaxisnumericlabel{%d}", (int) val); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/axes.c:342:26: [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. if (abs_diff > 0.1) snprintf(buff, sizeof(buff), (s->vertical)? "\\tiogayaxisnumericlabel{10^{%0.1f}}" : "\\tiogaxaxisnumericlabel{10^{%0.1f}}", val); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/axes.c:343:30: [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). else if (exponent == 0) strcpy(buff, (s->vertical)? data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/axes.c:346:30: [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). else if (exponent == 1) strcpy(buff, (s->vertical)? data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/axes.c:349:11: [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. else snprintf(buff, sizeof(buff), (s->vertical)? "\\tiogayaxisnumericlabel{10^{%d}}" : "\\tiogaxaxisnumericlabel{10^{%d}}", exponent); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/axes.c:358:7: [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. snprintf(form, sizeof(form), (s->vertical)? "\\tiogayaxisnumericlabel{%%.%df}" : "\\tiogaxaxisnumericlabel{%%.%df}", (int) prec); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/axes.c:359:7: [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. snprintf(buff, sizeof(buff), form, val); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/axes.c:362:27: [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). if (postfix != NULL) { strcpy(buff+len, postfix); len = strlen(buff); } data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/axes.c:364:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(string, buff); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/axes.c:476:5: [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. snprintf(ps = postfix, sizeof(postfix), data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdffile.c:207:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(timestring, ctime(&now)); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdfimage.c:181: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). strcpy(val->filename, file); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdfimage.c:404: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(xo->filename, filename); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/texout.c:105:4: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(fp, (alignment == ALIGNED_AT_BASELINE)? "%s}\\BS" : "%s}", text); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/texout.c:106:4: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(fp, angle != 0? "}}}}}\n" : "}}}}\n"); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/texout.c:313:7: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(base_name, fname); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/texout.c:317:7: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(simple_name, dot+1); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/texout.c:320:7: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(simple_name, base_name); data/ruby-tioga-1.19.1/tests/profile_Dvector/prepare_file.c:29:30: [3] (random) drand48: 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. fprintf(tmp, "%g\t%g\n", drand48(), drand48()); data/ruby-tioga-1.19.1/tests/profile_Dvector/prepare_file.c:29:41: [3] (random) drand48: 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. fprintf(tmp, "%g\t%g\n", drand48(), drand48()); data/ruby-tioga-1.19.1/tests/profile_Dvector/profile_fancy_read.c:38:30: [3] (random) drand48: 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. fprintf(tmp, "%g\t%g\n", drand48(), drand48()); data/ruby-tioga-1.19.1/tests/profile_Dvector/profile_fancy_read.c:38:41: [3] (random) drand48: 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. fprintf(tmp, "%g\t%g\n", drand48(), drand48()); data/ruby-tioga-1.19.1/ext/Dobjects/Dtable/dtable.c:1574:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char c, buff[buff_len], *p, *pend, err_str[err_len]; data/ruby-tioga-1.19.1/ext/Dobjects/Dtable/dtable.c:1576: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 ((file=fopen(filename,"r")) == NULL) data/ruby-tioga-1.19.1/ext/Dobjects/Dvector/dvector.c:1589:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buff[100]; data/ruby-tioga-1.19.1/ext/Dobjects/Dvector/dvector.c:4609: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 ((file=fopen(filename,"r")) == NULL) { data/ruby-tioga-1.19.1/ext/Dobjects/Dvector/dvector.c:4754: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 ((file=fopen(filename,"r")) == NULL) { data/ruby-tioga-1.19.1/ext/Dobjects/Dvector/dvector.c:4857:34: [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 (filename == NULL || (file=fopen(filename,"r")) == NULL) { data/ruby-tioga-1.19.1/ext/Flate/zlib/crc32.c:161:15: [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). out = fopen("crc32.h", "w"); data/ruby-tioga-1.19.1/ext/Flate/zlib/gzio.c:103: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 fmode[80]; /* copy of mode, without the compression level */ data/ruby-tioga-1.19.1/ext/Flate/zlib/gzio.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 name[46]; /* allow for up to 128-bit integers */ data/ruby-tioga-1.19.1/ext/Flate/zlib/gzio.c:226: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(name, "<fd:%d>", fd); /* for debugging */ data/ruby-tioga-1.19.1/ext/Flate/zlib/gzio.c:605: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[Z_PRINTF_BUFSIZE]; data/ruby-tioga-1.19.1/ext/Flate/zlib/gzio.c:644: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[Z_PRINTF_BUFSIZE]; data/ruby-tioga-1.19.1/ext/Flate/zlib/gzio.c:1009:5: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(s->msg, ": "); data/ruby-tioga-1.19.1/ext/Flate/zlib/inflate.c:572: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 hbuf[4]; /* buffer for gzip header crc calculation */ data/ruby-tioga-1.19.1/ext/Flate/zlib/inflate.c:1267: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 buf[4]; /* to restore bit buffer to byte string */ data/ruby-tioga-1.19.1/ext/Flate/zlib/trees.c:332:20: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *header = fopen("trees.h", "w"); data/ruby-tioga-1.19.1/ext/Flate/zlib/zutil.c:14: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. const char * const z_errmsg[10] = { data/ruby-tioga-1.19.1/ext/Flate/zlib/zutil.h:53: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. extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ data/ruby-tioga-1.19.1/ext/Flate/zlib/zutil.h:111:6: [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). fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") data/ruby-tioga-1.19.1/ext/Flate/zlib/zutil.h:173:30: [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 F_OPEN(name, mode) fopen((name), (mode)) data/ruby-tioga-1.19.1/ext/Flate/zlib/zutil.h:230:21: [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 zmemcpy memcpy data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/generic.c:122:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buff[err_buff_len]; data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/generic.c:128:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buff[err_buff_len]; data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/generic.c:134:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buff[err_buff_len]; data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/generic.c:140:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buff[err_buff_len]; data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/generic.c:146:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buff[err_buff_len]; data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/generic.c:152:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buff[err_buff_len]; data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/init.c:330: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. strcpy(full_name+j, ".pdf"); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/init.c:336:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char full_name[STRLEN]; data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/init.c:346:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char full_name[STRLEN]; data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/init.c:377:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char full_name[STRLEN]; data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/axes.c:323:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buff[100], form[100], *string; data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/axes.c:461:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char postfix[50], *ps; data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdfcolor.c:77: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(fo->lookup, lookup, lookup_len); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdffile.c:171:4: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(ofile, "_figure.pdf"); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdffile.c:194:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ofile[300], timestring[100]; data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdffile.c:196: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 ((OF = fopen(ofile, "wb")) == NULL) { /* Write binary file ! */ data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdffile.c:200:14: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). if ((TF = tmpfile()) == NULL) { data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdffile.c:295:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[80]; data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdffile.c:446:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char old_ofile[300], new_ofile[300]; data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdfimage.c:150: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). FILE * f = fopen(file, "rb"); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdfimage.c:228: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). FILE *jpg = fopen(filename, "rb"); /* We read binary files ! */ data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdfimage.c:341: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(image_data, xo->image_data, xo->length); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdfimage.c:646: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(xo->image_data, data, len); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdfimage.c:651:6: [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(xo->filters, filters, len); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdfimage.c:667: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(xo->lookup, lookup, lookup_len); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdftext.c:93: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). file = fopen("pdf_font_dicts.c", "w"); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/texout.c:211:4: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(ofile, "_figure.txt"); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/texout.c:216:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ofile[300]; data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/texout.c:219:9: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(ofile, "w"); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/texout.c:306:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tex_fname[100], base_name[100], simple_name[100]; data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/texout.c:322: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). file = fopen(tex_fname, "w"); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/texout.c:343:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char old_ofile[300], new_ofile[300]; data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/texout.c:353: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 tex_fname[256]; data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/texout.c:355: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). file = fopen(tex_fname, "w"); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/texout.c:523: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[4]; data/ruby-tioga-1.19.1/samples/plots/data/builder.c:28:20: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((file=fopen(fname, "w"))==NULL) continue; data/ruby-tioga-1.19.1/tests/profile_Dvector/prepare_file.c:26: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). int i, imax = atoi(argv[1]); data/ruby-tioga-1.19.1/tests/profile_Dvector/prepare_file.c:27: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). FILE * tmp = fopen("tmp.dat", "w"); data/ruby-tioga-1.19.1/tests/profile_Dvector/profile_fancy_read.c:36: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). FILE * tmp = fopen("tmp.dat", "w"); data/ruby-tioga-1.19.1/ext/Dobjects/Dtable/dtable.c:1593:20: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c=getc(file)) != EOF) { data/ruby-tioga-1.19.1/ext/Dobjects/Dtable/dtable.c:1598:20: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c=getc(file)) != EOF) { data/ruby-tioga-1.19.1/ext/Dobjects/Dtable/dtable.c:1614:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(err_str,buff,len); data/ruby-tioga-1.19.1/ext/Dobjects/Dvector/dvector.c:4552: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). line_len = strlen(buff); data/ruby-tioga-1.19.1/ext/Flate/zlib/gzio.c:127:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). s->path = (char*)ALLOC(strlen(path)+1); data/ruby-tioga-1.19.1/ext/Flate/zlib/gzio.c:625: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). len = strlen(buf); data/ruby-tioga-1.19.1/ext/Flate/zlib/gzio.c:662: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). len = strlen(buf); data/ruby-tioga-1.19.1/ext/Flate/zlib/gzio.c:697:46: [1] (buffer) strlen: Does not handle 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 gzwrite(file, (char*)s, (unsigned)strlen(s)); data/ruby-tioga-1.19.1/ext/Flate/zlib/gzio.c:1006: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). s->msg = (char*)ALLOC(strlen(s->path) + strlen(m) + 3); data/ruby-tioga-1.19.1/ext/Flate/zlib/gzio.c:1006:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). s->msg = (char*)ALLOC(strlen(s->path) + strlen(m) + 3); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/generic.c:72: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(cs)) { RAISE_ERROR("invalid C string; contains NULL character",ierr); return NULL; } data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/init.c:316: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 (with_save_dir && save != NULL && strlen(save) > 0) { data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/init.c:317:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). sprintf(full_name, "%s/", save); j = strlen(full_name); } data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/init.c:320: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(f_name); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/axes.c:361: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 len = strlen(buff); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/axes.c:362:60: [1] (buffer) strlen: Does not handle 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 (postfix != NULL) { strcpy(buff+len, postfix); len = strlen(buff); } data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/axes.c:884: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). long len = strlen(text) + 100; /* Should be enough overhead ! */ data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdffile.c:168:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ofile, filename, maxlen); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdffile.c:208:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). i = strlen(timestring); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdffile.c:298: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(line); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdfimage.c:83:11: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = fgetc(file); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdfimage.c:94:11: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int v = fgetc(file); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdfimage.c:95:11: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = fgetc(file); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdfimage.c:180: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). val->filename = ALLOC_N_char(strlen(file)+1); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdfimage.c:403: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). xo->filename = ALLOC_N_char(strlen(filename)+1); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdfimage.c:649:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(filters) + 1; data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/pdftext.c:390: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). if (font_number == 14 && strlen((char *)text) == 1 data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/texout.c:208:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ofile, filename, maxlen); data/ruby-tioga-1.19.1/ext/Tioga/FigureMaker/shared/texout.c:309:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(base_name, fname, dot-fname); base_name[dot-fname] = '\0'; ANALYSIS SUMMARY: Hits = 139 Lines analyzed = 52124 in approximately 1.28 seconds (40787 lines/second) Physical Source Lines of Code (SLOC) = 40408 Hits@level = [0] 297 [1] 29 [2] 60 [3] 4 [4] 46 [5] 0 Hits@level+ = [0+] 436 [1+] 139 [2+] 110 [3+] 50 [4+] 46 [5+] 0 Hits/KSLOC@level+ = [0+] 10.7899 [1+] 3.43991 [2+] 2.72223 [3+] 1.23738 [4+] 1.13839 [5+] 0 Symlinks skipped = 10 (--allowlink overrides but see doc for security issue) 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.