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/bs1770gain-0.6.5/config.h Examining data/bs1770gain-0.6.5/lib1770-2/lib1770.h Examining data/bs1770gain-0.6.5/lib1770-2/lib1770_biquad.c Examining data/bs1770gain-0.6.5/lib1770-2/lib1770_block.c Examining data/bs1770gain-0.6.5/lib1770-2/lib1770_pre.c Examining data/bs1770gain-0.6.5/lib1770-2/lib1770_stats.c Examining data/bs1770gain-0.6.5/libbg/bg.h Examining data/bs1770gain-0.6.5/libbg/bg_album.c Examining data/bs1770gain-0.6.5/libbg/bg_analyzer.c Examining data/bs1770gain-0.6.5/libbg/bg_annotator.c Examining data/bs1770gain-0.6.5/libbg/bg_basename.c Examining data/bs1770gain-0.6.5/libbg/bg_basenamea.c Examining data/bs1770gain-0.6.5/libbg/bg_file.c Examining data/bs1770gain-0.6.5/libbg/bg_muxer.c Examining data/bs1770gain-0.6.5/libbg/bg_param.c Examining data/bs1770gain-0.6.5/libbg/bg_parse_time.c Examining data/bs1770gain-0.6.5/libbg/bg_pathnorm.c Examining data/bs1770gain-0.6.5/libbg/bg_pilot.c Examining data/bs1770gain-0.6.5/libbg/bg_pilot.h Examining data/bs1770gain-0.6.5/libbg/bg_pilot_branch.c Examining data/bs1770gain-0.6.5/libbg/bg_pilot_leaf.c Examining data/bs1770gain-0.6.5/libbg/bg_print_classic.c Examining data/bs1770gain-0.6.5/libbg/bg_print_conf.c Examining data/bs1770gain-0.6.5/libbg/bg_print_xml.c Examining data/bs1770gain-0.6.5/libbg/bg_root.c Examining data/bs1770gain-0.6.5/libbg/bg_track.c Examining data/bs1770gain-0.6.5/libbg/bg_track_target.c Examining data/bs1770gain-0.6.5/libbg/bg_tree.c Examining data/bs1770gain-0.6.5/libbg/bg_tree_path.c Examining data/bs1770gain-0.6.5/libbg/bg_tree_patha.c Examining data/bs1770gain-0.6.5/libbg/bg_version.c Examining data/bs1770gain-0.6.5/libbg/bg_wcs2str.c Examining data/bs1770gain-0.6.5/libbg/bgx.c Examining data/bs1770gain-0.6.5/libff/ff.h Examining data/bs1770gain-0.6.5/libff/ff_analyzer.c Examining data/bs1770gain-0.6.5/libff/ff_audio.c Examining data/bs1770gain-0.6.5/libff/ff_csv2avdict.c Examining data/bs1770gain-0.6.5/libff/ff_dynload.c Examining data/bs1770gain-0.6.5/libff/ff_fcmp.c Examining data/bs1770gain-0.6.5/libff/ff_fexists.c Examining data/bs1770gain-0.6.5/libff/ff_fifo.c Examining data/bs1770gain-0.6.5/libff/ff_filter.c Examining data/bs1770gain-0.6.5/libff/ff_inout.c Examining data/bs1770gain-0.6.5/libff/ff_iter.c Examining data/bs1770gain-0.6.5/libff/ff_mkdir.c Examining data/bs1770gain-0.6.5/libff/ff_muxer.c Examining data/bs1770gain-0.6.5/libff/ff_mv.c Examining data/bs1770gain-0.6.5/libff/ff_printer.c Examining data/bs1770gain-0.6.5/libff/ff_resampler.c Examining data/bs1770gain-0.6.5/libff/ff_rm.c Examining data/bs1770gain-0.6.5/libff/ff_wcs2str.c Examining data/bs1770gain-0.6.5/libpbutil/pbutil.h Examining data/bs1770gain-0.6.5/libpbutil/pbutil_priv.h Examining data/bs1770gain-0.6.5/libpbutil/pbu_basename.c Examining data/bs1770gain-0.6.5/libpbutil/pbu_msvcrt.c Examining data/bs1770gain-0.6.5/libpbutil/pbu_strtok.c Examining data/bs1770gain-0.6.5/libpbutil/pbu_vwritelna.c Examining data/bs1770gain-0.6.5/libpbutil/pbu_vwritelnw.c FINAL RESULTS: data/bs1770gain-0.6.5/libff/ff_dynload.c:1812:12: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. if ((len=readlink(process_path,path,SIZE-1))<0) data/bs1770gain-0.6.5/libbg/bg_annotator.c:285:13: [4] (format) swprintf: Potential format string problem (CWE-134). Make format string constant. len=swprintf(*opath,1+track->target.pfx.len,L"%02d_", data/bs1770gain-0.6.5/libbg/bg_annotator.c:291:7: [4] (format) swprintf: Potential format string problem (CWE-134). Make format string constant. swprintf(*opath,1+track->target.pfx.len, data/bs1770gain-0.6.5/libbg/bg_annotator.c:294:7: [4] (buffer) wcscpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using a function version that stops copying at the end of the buffer. wcscpy(*opath+track->target.pfx.len,track->target.title); data/bs1770gain-0.6.5/libbg/bg_annotator.c:389:13: [4] (format) swprintf: Potential format string problem (CWE-134). Make format string constant. len=swprintf(NULL,0,L"%02d_",atoi(tag.track->value)); data/bs1770gain-0.6.5/libbg/bg_annotator.c:394:11: [4] (format) swprintf: Potential format string problem (CWE-134). Make format string constant. len=swprintf(NULL,0, data/bs1770gain-0.6.5/libbg/bg_annotator.c:411: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(*opath,1+track->target.pfx.len, data/bs1770gain-0.6.5/libbg/bg_annotator.c:476: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(NULL,0,track->album.id<100?"%02lu_":"%lu_",track->album.id); data/bs1770gain-0.6.5/libbg/bg_muxer.c:545: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(key,param->tag.pfx); data/bs1770gain-0.6.5/libbg/bg_pilot.c:186:3: [4] (buffer) wcscpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using a function version that stops copying at the end of the buffer. wcscpy(mp,cur->path); data/bs1770gain-0.6.5/libbg/bg_pilot.c:209: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(pp,root); data/bs1770gain-0.6.5/libbg/bg_pilot.c:217: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(pp,path); data/bs1770gain-0.6.5/libbg/bg_print_classic.c:64: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(format.n,FORMAT_SIZE,c->n.format.classic,width); data/bs1770gain-0.6.5/libbg/bg_print_classic.c:73:9: [4] (format) fwprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fwprintf(f,format.w,c->w.label,c->argv[0](tree),c->w.unit(tree)); data/bs1770gain-0.6.5/libbg/bg_print_classic.c:76:9: [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(f,format.n,c->n.label,c->argv[0](tree),c->n.unit(tree)); data/bs1770gain-0.6.5/libbg/bg_print_classic.c:88:9: [4] (format) fwprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fwprintf(f,format.w,c->w.label,c->argv[0](tree),c->w.unit(tree), data/bs1770gain-0.6.5/libbg/bg_print_classic.c:93:9: [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(f,format.n,c->n.label,c->argv[0](tree),c->n.unit(tree), data/bs1770gain-0.6.5/libbg/bg_print_xml.c:76:7: [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(f,format.n,""); data/bs1770gain-0.6.5/libbg/bg_print_xml.c:81:7: [4] (format) fwprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fwprintf(f,format.w,L""); data/bs1770gain-0.6.5/libbg/bg_print_xml.c:171:9: [4] (format) fwprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fwprintf(f,c->w.format.xml,unit.w,c->argv[0](tree)); data/bs1770gain-0.6.5/libbg/bg_print_xml.c:177:9: [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(f,c->n.format.xml,unit.m,c->argv[0](tree)); data/bs1770gain-0.6.5/libbg/bg_print_xml.c:198:11: [4] (format) fwprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fwprintf(f,c->w.format.xml,unit.w,c->argv[0](tree), data/bs1770gain-0.6.5/libbg/bg_print_xml.c:202:11: [4] (format) fwprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fwprintf(f,c->w.format.xml,unit.w,c->argv[0](tree), data/bs1770gain-0.6.5/libbg/bg_print_xml.c:212:11: [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(f,c->n.format.xml,unit.m,c->argv[0](tree), data/bs1770gain-0.6.5/libbg/bg_print_xml.c:216:11: [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(f,c->n.format.xml,unit.m,c->argv[0](tree), data/bs1770gain-0.6.5/libff/ff.h:60:25: [4] (buffer) wcscpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using a function version that stops copying at the end of the buffer. #define FFSTRCPY(s1,s2) wcscpy(s1,s2) data/bs1770gain-0.6.5/libff/ff.h:67:33: [4] (format) fwprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define _FFPRINTF(f,format,...) fwprintf(f,format,__VA_ARGS__) data/bs1770gain-0.6.5/libff/ff.h:69:38: [4] (format) swprintf: Potential format string problem (CWE-134). Make format string constant. #define FFSPRINTF(s,size,format,...) swprintf(s,size,format,__VA_ARGS__) data/bs1770gain-0.6.5/libff/ff.h:100:25: [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 FFSTRCPY(s1,s2) strcpy(s1,s2) data/bs1770gain-0.6.5/libff/ff.h:107:33: [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 _FFPRINTF(f,format,...) fprintf(f,format,__VA_ARGS__) data/bs1770gain-0.6.5/libff/ff.h:109:38: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. #define FFSPRINTF(s,size,format,...) sprintf(s,format,__VA_ARGS__) data/bs1770gain-0.6.5/libff/ff.h:110:39: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define FFSNPRINTF(s,size,format,...) snprintf(s,size,format,__VA_ARGS__) data/bs1770gain-0.6.5/libff/ff_csv2avdict.c:607:3: [4] (buffer) wcscpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using a function version that stops copying at the end of the buffer. wcscpy(csvw+len,PRIV_FOLDER_CSV); data/bs1770gain-0.6.5/libff/ff_csv2avdict.c:628: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(csv+len,PRIV_FOLDER_CSV); data/bs1770gain-0.6.5/libff/ff_filter.c:75:3: [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(args,sizeof args, data/bs1770gain-0.6.5/libff/ff_printer.c:103:10: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. p->len=vsprintf(buf,format,ap); data/bs1770gain-0.6.5/libff/ff_printer.c:105:10: [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. p->len=vsnprintf(buf,BUF_SIZE,format,ap); data/bs1770gain-0.6.5/libff/ff_printer.c:121:10: [4] (format) vswprintf: Potential format string problem (CWE-134). Make format string constant. p->len=vswprintf(buf,BUF_SIZE,format,ap); data/bs1770gain-0.6.5/libpbutil/pbu_basename.c:46: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(clone,ss); data/bs1770gain-0.6.5/libpbutil/pbu_vwritelna.c:42:5: [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(f,format,ap); data/bs1770gain-0.6.5/libpbutil/pbu_vwritelnw.c:34:5: [4] (format) vfwprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfwprintf(f,format,ap); data/bs1770gain-0.6.5/libpbutil/pbutil.h:148:7: [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(stderr,cs,__VA_ARGS__) data/bs1770gain-0.6.5/libpbutil/pbutil.h:152:7: [4] (format) fwprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fwprintf(stderr,ws,__VA_ARGS__) data/bs1770gain-0.6.5/libbg/bgx.c:630:20: [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 *lang=getenv("LANG"); data/bs1770gain-0.6.5/libff/ff.h:84:5: [3] (buffer) getopt_long: 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. getopt_long(argc,argv,optstring,longopts,longindex) data/bs1770gain-0.6.5/libff/ff_dynload.c:1856:20: [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 *lang=getenv("LANG"); data/bs1770gain-0.6.5/libbg/bg.h:491: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[64]; data/bs1770gain-0.6.5/libbg/bg.h:555: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 pfx[128]; data/bs1770gain-0.6.5/libbg/bg_annotator.c:286:13: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). atoi(tag.track->value)); data/bs1770gain-0.6.5/libbg/bg_annotator.c:300:11: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). len=MultiByteToWideChar( data/bs1770gain-0.6.5/libbg/bg_annotator.c:322:7: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). MultiByteToWideChar( data/bs1770gain-0.6.5/libbg/bg_annotator.c:389:38: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). len=swprintf(NULL,0,L"%02d_",atoi(tag.track->value)); data/bs1770gain-0.6.5/libbg/bg_annotator.c:408:13: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). atoi(tag.track->value)); data/bs1770gain-0.6.5/libbg/bg_annotator.c:472:37: [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). len=snprintf(NULL,0,"%02d_",atoi(tag.track->value)); data/bs1770gain-0.6.5/libbg/bg_annotator.c:489:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(*opath,ipath,len*sizeof **opath); data/bs1770gain-0.6.5/libbg/bg_annotator.c:544: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(tp,tree->source.path,len1*sizeof tree->source.path[0]); data/bs1770gain-0.6.5/libbg/bg_annotator.c:608: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(tp,tree->target.path,len1*sizeof tp[0]); data/bs1770gain-0.6.5/libbg/bg_muxer.c:72: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[4096],*bp; data/bs1770gain-0.6.5/libbg/bg_muxer.c:75:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd.source=open(source,O_RDONLY); data/bs1770gain-0.6.5/libbg/bg_muxer.c:83:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd.target=open(target,O_WRONLY|O_CREAT|O_EXCL,0666); data/bs1770gain-0.6.5/libbg/bg_muxer.c:175: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 filter[128]; data/bs1770gain-0.6.5/libbg/bg_muxer.c:409: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 ovalue[128]; data/bs1770gain-0.6.5/libbg/bg_muxer.c:527: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 key[128]; data/bs1770gain-0.6.5/libbg/bg_muxer.c:548: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(key+len,"ALGORITHM"); data/bs1770gain-0.6.5/libbg/bg_muxer.c:553: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(key+len,"REFERENCE_LOUDNESS"); data/bs1770gain-0.6.5/libbg/bg_muxer.c:558: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(key+len,"TRACK_GAIN"); data/bs1770gain-0.6.5/libbg/bg_muxer.c:563: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(key+len,"TRACK_PEAK"); data/bs1770gain-0.6.5/libbg/bg_muxer.c:568: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(key+len,"ALBUM_GAIN"); data/bs1770gain-0.6.5/libbg/bg_muxer.c:573: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(key+len,"ALBUM_PEAK"); data/bs1770gain-0.6.5/libbg/bg_print_classic.c:51:5: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t w[FORMAT_SIZE]; data/bs1770gain-0.6.5/libbg/bg_print_classic.c:54: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 n[FORMAT_SIZE]; data/bs1770gain-0.6.5/libbg/bg_print_xml.c:61: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 n[SIZE]; data/bs1770gain-0.6.5/libbg/bg_print_xml.c:64:5: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t w[SIZE]; data/bs1770gain-0.6.5/libbg/bg_print_xml.c:155:5: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t w[SIZE_UNIT]; data/bs1770gain-0.6.5/libbg/bg_print_xml.c:157: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 m[SIZE_UNIT]; data/bs1770gain-0.6.5/libbg/bgx.c:1441: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). param.result.f=fopen(fpath,"w"); data/bs1770gain-0.6.5/libff/ff.h:54:19: [2] (integer) _wtoi: 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 FFATOI(x) _wtoi(x) data/bs1770gain-0.6.5/libff/ff.h:90: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). #define FFATOI(x) atoi(x) data/bs1770gain-0.6.5/libff/ff.h:102: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 FFFOPEN(path,mode) fopen(path,mode) data/bs1770gain-0.6.5/libff/ff_audio.c:37: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 value[64]; data/bs1770gain-0.6.5/libff/ff_audio.c:225: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(value,"%0.1f",iparam->drc.scale); data/bs1770gain-0.6.5/libff/ff_csv2avdict.c:45: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 ch[PRIV_CH_SIZE+1]; data/bs1770gain-0.6.5/libff/ff_csv2avdict.c:216:6: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). n1=MultiByteToWideChar( data/bs1770gain-0.6.5/libff/ff_csv2avdict.c:228:6: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). n2=MultiByteToWideChar( data/bs1770gain-0.6.5/libff/ff_csv2avdict.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(b->wp,ch,n); data/bs1770gain-0.6.5/libff/ff_csv2avdict.c:481: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(head,b.buf,b.wp-b.buf); data/bs1770gain-0.6.5/libff/ff_csv2avdict.c:605: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(csvw,pathw,len*sizeof csvw[0]); data/bs1770gain-0.6.5/libff/ff_csv2avdict.c:627: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(csv,path,len*sizeof csv[0]); data/bs1770gain-0.6.5/libff/ff_csv2avdict.c:629:5: [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). f=fopen(csv,"rb"); data/bs1770gain-0.6.5/libff/ff_csv2avdict.c:694:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (NULL==(f=fopen(argv[1],"rb"))) data/bs1770gain-0.6.5/libff/ff_csv2avdict.c:708: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(head,b.buf,b.wp-b.buf); data/bs1770gain-0.6.5/libff/ff_dynload.c:1799: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 process_path[64]; data/bs1770gain-0.6.5/libff/ff_dynload.c:1810: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(process_path,"/proc/%d/exe",getpid()); data/bs1770gain-0.6.5/libff/ff_dynload.c:1855: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 patha[PATH_MAX]; data/bs1770gain-0.6.5/libff/ff_filter.c:41: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 args[512]; data/bs1770gain-0.6.5/libff/ff_printer.c:99: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[BUF_SIZE]; data/bs1770gain-0.6.5/libff/ff_printer.c:118:3: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t buf[BUF_SIZE]; data/bs1770gain-0.6.5/libpbutil/pbu_basename.c:27: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 *pp[2]={ 0 },*p; data/bs1770gain-0.6.5/libpbutil/pbu_basename.c:29: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 clone[PATH_MAX]; data/bs1770gain-0.6.5/libbg/bg_annotator.c:305: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(tag.title->value), data/bs1770gain-0.6.5/libbg/bg_annotator.c:327: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(tag.title->value), data/bs1770gain-0.6.5/libbg/bg_annotator.c:359:30: [1] (buffer) wcslen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memmove(op,op+1,(wcslen(op+1)+1)*sizeof *op); data/bs1770gain-0.6.5/libbg/bg_annotator.c:398:12: [1] (buffer) wcslen: Does not handle 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+=wcslen(track->target.title); data/bs1770gain-0.6.5/libbg/bg_annotator.c:453:30: [1] (buffer) wcslen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memmove(op,op+1,(wcslen(op+1)+1)*sizeof *op); data/bs1770gain-0.6.5/libbg/bg_basename.c:30:9: [1] (buffer) wcslen: Does not handle 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 (1<wcslen(bn)&&L':'==bn[1]) { data/bs1770gain-0.6.5/libbg/bg_basenamea.c:30: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). if (1<strlen(bn)&&':'==bn[1]) { data/bs1770gain-0.6.5/libbg/bg_muxer.c:91:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). size=read(fd.source,buf,sizeof buf); data/bs1770gain-0.6.5/libbg/bg_muxer.c:408: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). size_t len=strlen(param->tag.pfx); data/bs1770gain-0.6.5/libbg/bg_muxer.c:429:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(ovalue,"BS.1770",(sizeof ovalue)-1); data/bs1770gain-0.6.5/libbg/bg_muxer.c:524: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). size_t len=strlen(param->tag.pfx); data/bs1770gain-0.6.5/libbg/bg_param.c:134:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(param->tag.pfx,"REPLAYGAIN_",(sizeof param->tag)-1); data/bs1770gain-0.6.5/libbg/bg_pilot.c:187:7: [1] (buffer) wcslen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). mp+=wcslen(mask); data/bs1770gain-0.6.5/libbg/bg_print_classic.c:36:12: [1] (buffer) wcslen: Does not handle 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 wcslen(c->w.label); data/bs1770gain-0.6.5/libbg/bg_print_classic.c:39: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). return strlen(c->n.label); data/bs1770gain-0.6.5/libbg/bg_print_xml.c:169:9: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(unit.w,c->w.unit(tree),SIZE_UNIT-1); data/bs1770gain-0.6.5/libbg/bg_print_xml.c:175:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(unit.m,c->n.unit(tree),SIZE_UNIT-1); data/bs1770gain-0.6.5/libbg/bg_print_xml.c:194:9: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(unit.w,c->w.unit(tree),SIZE_UNIT-1); data/bs1770gain-0.6.5/libbg/bg_print_xml.c:208:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(unit.m,c->n.unit(tree),SIZE_UNIT-1); data/bs1770gain-0.6.5/libbg/bgx.c:856:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(param.tag.pfx,optarg,(sizeof param.tag.pfx)-2); data/bs1770gain-0.6.5/libbg/bgx.c:858:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). param.tag.pfx[strlen(param.tag.pfx)+1]='\0'; data/bs1770gain-0.6.5/libbg/bgx.c:859:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). param.tag.pfx[strlen(param.tag.pfx)]='_'; data/bs1770gain-0.6.5/libff/ff.h:58:21: [1] (buffer) wcslen: Does not handle 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 FFSTRLEN(s) wcslen(s) data/bs1770gain-0.6.5/libff/ff.h:98:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). #define FFSTRLEN(s) strlen(s) data/bs1770gain-0.6.5/libff/ff_analyzer.c:424:1: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read: data/bs1770gain-0.6.5/libff/ff_analyzer.c:433:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). goto read; data/bs1770gain-0.6.5/libff/ff_analyzer.c:444:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). goto read; data/bs1770gain-0.6.5/libff/ff_analyzer.c:454:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). goto read; data/bs1770gain-0.6.5/libff/ff_csv2avdict.c:278:15: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (EOF==(i=getc(b->f))) { data/bs1770gain-0.6.5/libff/ff_csv2avdict.c:315:44: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). static int priv_get_utf16(priv_t *b, int (*read)(wchar_t *, FILE *)) data/bs1770gain-0.6.5/libff/ff_csv2avdict.c:321:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (0!=read(&wch,b->f)) { data/bs1770gain-0.6.5/libff/ff_csv2avdict.c:417:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). n=strlen(ch); data/bs1770gain-0.6.5/libff/ff_csv2avdict.c:499:56: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for (hrp=head;hrp<hmp&&NULL!=hrp&&NULL!=rp;hrp=hrp+strlen(hrp)+1) { data/bs1770gain-0.6.5/libff/ff_csv2avdict.c:512: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). pp=rp+strlen(rp)+1; data/bs1770gain-0.6.5/libff/ff_csv2avdict.c:598:20: [1] (buffer) wcslen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). csvw=malloc((len+wcslen(PRIV_FOLDER_CSV)+1)*sizeof csvw[0]); data/bs1770gain-0.6.5/libff/ff_csv2avdict.c:620:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). csv=malloc((len+strlen(PRIV_FOLDER_CSV)+1)*sizeof csv[0]); data/bs1770gain-0.6.5/libff/ff_csv2avdict.c:726:56: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for (hrp=head;hrp<hmp&&NULL!=hrp&&NULL!=rp;hrp=hrp+strlen(hrp)+1) { data/bs1770gain-0.6.5/libff/ff_csv2avdict.c:731: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). pp=rp+strlen(rp)+1; data/bs1770gain-0.6.5/libff/ff_dynload.c:1815: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). len=strlen(pp); data/bs1770gain-0.6.5/libff/ff_mkdir.c:81:14: [1] (buffer) wcslen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). else if (1<wcslen(pp)&&L':'==pp[1]) data/bs1770gain-0.6.5/libff/ff_muxer.c:397:1: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read: data/bs1770gain-0.6.5/libff/ff_muxer.c:406:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). goto read; data/bs1770gain-0.6.5/libff/ff_muxer.c:435:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). goto read; data/bs1770gain-0.6.5/libff/ff_muxer.c:460:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). goto read; data/bs1770gain-0.6.5/libff/ff_muxer.c:467:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). goto read; data/bs1770gain-0.6.5/libff/ff_muxer.c:477:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). goto read; data/bs1770gain-0.6.5/libpbutil/pbu_basename.c:25: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). int len=strlen(path); data/bs1770gain-0.6.5/libpbutil/pbu_basename.c:55: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). pp[0]=p+strlen(p); data/bs1770gain-0.6.5/libpbutil/pbu_basename.c:69: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). pp[0]=p+strlen(p); data/bs1770gain-0.6.5/libpbutil/pbu_basename.c:74: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). else if (strlen(pp[0])) data/bs1770gain-0.6.5/libpbutil/pbu_basename.c:96: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). p=path+strlen(path); data/bs1770gain-0.6.5/libpbutil/pbu_basename.c:122:11: [1] (buffer) wcslen: Does not handle 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=wpath+wcslen(wpath); data/bs1770gain-0.6.5/libpbutil/pbu_vwritelna.c:33: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). p=path+strlen(path); data/bs1770gain-0.6.5/libpbutil/pbu_vwritelna.c:55: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). p=path+strlen(path); data/bs1770gain-0.6.5/libpbutil/pbu_vwritelnw.c:46: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). p=path+strlen(path); ANALYSIS SUMMARY: Hits = 154 Lines analyzed = 16557 in approximately 0.43 seconds (38149 lines/second) Physical Source Lines of Code (SLOC) = 12021 Hits@level = [0] 84 [1] 55 [2] 53 [3] 3 [4] 42 [5] 1 Hits@level+ = [0+] 238 [1+] 154 [2+] 99 [3+] 46 [4+] 43 [5+] 1 Hits/KSLOC@level+ = [0+] 19.7987 [1+] 12.8109 [2+] 8.23559 [3+] 3.82664 [4+] 3.57707 [5+] 0.0831878 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.