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/libao-1.2.2+20180113/doc/ao_example.c Examining data/libao-1.2.2+20180113/include/ao/ao.h Examining data/libao-1.2.2+20180113/include/ao/ao_private.h Examining data/libao-1.2.2+20180113/include/ao/plugin.h Examining data/libao-1.2.2+20180113/src/ao_aixs.c Examining data/libao-1.2.2+20180113/src/ao_au.c Examining data/libao-1.2.2+20180113/src/ao_null.c Examining data/libao-1.2.2+20180113/src/ao_raw.c Examining data/libao-1.2.2+20180113/src/ao_wav.c Examining data/libao-1.2.2+20180113/src/ao_wmm.c Examining data/libao-1.2.2+20180113/src/audio_out.c Examining data/libao-1.2.2+20180113/src/config.c Examining data/libao-1.2.2+20180113/src/plugins/alsa/ao_alsa.c Examining data/libao-1.2.2+20180113/src/plugins/arts/ao_arts.c Examining data/libao-1.2.2+20180113/src/plugins/esd/ao_esd.c Examining data/libao-1.2.2+20180113/src/plugins/irix/ao_irix.c Examining data/libao-1.2.2+20180113/src/plugins/macosx/ao_macosx.c Examining data/libao-1.2.2+20180113/src/plugins/nas/ao_nas.c Examining data/libao-1.2.2+20180113/src/plugins/oss/ao_oss.c Examining data/libao-1.2.2+20180113/src/plugins/pulse/ao_pulse.c Examining data/libao-1.2.2+20180113/src/plugins/roar/ao_roar.c Examining data/libao-1.2.2+20180113/src/plugins/sndio/ao_sndio.c Examining data/libao-1.2.2+20180113/src/plugins/sun/ao_sun.c FINAL RESULTS: data/libao-1.2.2+20180113/include/ao/ao_private.h:145: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(stderr,"ao_%s debug: " format,device->funcs->driver_info()->short_name,## args); \ data/libao-1.2.2+20180113/include/ao/ao_private.h:147: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(stderr,"debug: " format,## args); \ data/libao-1.2.2+20180113/include/ao/ao_private.h:159: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(stderr,"ao_%s info: " format,device->funcs->driver_info()->short_name,## args); \ data/libao-1.2.2+20180113/include/ao/ao_private.h:161: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(stderr,"info: " format,## args); \ data/libao-1.2.2+20180113/include/ao/ao_private.h:173: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(stderr,"ao_%s info: " format,device->funcs->driver_info()->short_name,## args); \ data/libao-1.2.2+20180113/include/ao/ao_private.h:175: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(stderr,"info: " format,## args); \ data/libao-1.2.2+20180113/include/ao/ao_private.h:187: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(stderr,"ao_%s WARNING: " format,device->funcs->driver_info()->short_name,## args); \ data/libao-1.2.2+20180113/include/ao/ao_private.h:189: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(stderr,"WARNING: " format,## args); \ data/libao-1.2.2+20180113/include/ao/ao_private.h:201: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(stderr,"ao_%s ERROR: " format,device->funcs->driver_info()->short_name,## args); \ data/libao-1.2.2+20180113/include/ao/ao_private.h:203: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(stderr,"ERROR: " format,## args); \ data/libao-1.2.2+20180113/src/audio_out.c:660:11: [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(ret,mnemonics[m]); data/libao-1.2.2+20180113/src/audio_out.c:836:7: [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(buffer,map[m]); data/libao-1.2.2+20180113/src/audio_out.c:891:7: [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(buffer,map[m]); data/libao-1.2.2+20180113/src/config.c:103:3: [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(userfile, AO_USER_CONFIG); data/libao-1.2.2+20180113/src/config.c:93:18: [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. char *homedir = getenv("HOME"); data/libao-1.2.2+20180113/src/plugins/pulse/ao_pulse.c:105:9: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("PULSE_SERVER") || getenv("PULSE_SINK")) data/libao-1.2.2+20180113/src/plugins/pulse/ao_pulse.c:105:35: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("PULSE_SERVER") || getenv("PULSE_SINK")) data/libao-1.2.2+20180113/src/plugins/sun/ao_sun.c:89:15: [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. dev = getenv(AO_SUN_ENV_DEV1); data/libao-1.2.2+20180113/src/plugins/sun/ao_sun.c:90:25: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (!dev) dev = getenv(AO_SUN_ENV_DEV2); data/libao-1.2.2+20180113/src/plugins/sun/ao_sun.c:118:15: [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. dev = getenv(AO_SUN_ENV_DEV1); data/libao-1.2.2+20180113/src/plugins/sun/ao_sun.c:119:25: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (!dev) dev = getenv(AO_SUN_ENV_DEV2); data/libao-1.2.2+20180113/include/ao/ao_private.h:129:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int (*open)(ao_device *device, ao_sample_format *format); data/libao-1.2.2+20180113/src/ao_aixs.c:82:8: [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 = open(AO_AIX_DEFAULT_DEV, O_WRONLY); data/libao-1.2.2+20180113/src/ao_aixs.c:84:10: [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 = open(AO_AIX_DEFAULT_DEV2, O_WRONLY); data/libao-1.2.2+20180113/src/ao_aixs.c:86:10: [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 = open(AO_AIX_DEFAULT_DEV3, O_WRONLY); data/libao-1.2.2+20180113/src/ao_aixs.c:126:20: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). internal->id = atoi(value); data/libao-1.2.2+20180113/src/ao_aixs.c:145:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[80]; data/libao-1.2.2+20180113/src/ao_aixs.c:148:11: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buffer,"/dev/baud%d/1",id); data/libao-1.2.2+20180113/src/ao_aixs.c:149:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(buffer, O_WRONLY); data/libao-1.2.2+20180113/src/ao_aixs.c:151:13: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buffer,"/dev/paud%d/1",id); data/libao-1.2.2+20180113/src/ao_aixs.c:152:18: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(buffer, O_WRONLY); data/libao-1.2.2+20180113/src/ao_aixs.c:155:13: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buffer,"/dev/acpa%d/1",id); data/libao-1.2.2+20180113/src/ao_aixs.c:156:18: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(buffer, O_WRONLY); data/libao-1.2.2+20180113/src/ao_aixs.c:162:32: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ( (internal->fd = open(internal->dev, O_WRONLY)) < 0 ) data/libao-1.2.2+20180113/src/ao_au.c:68:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char info[4]; /* optional text information */ data/libao-1.2.2+20180113/src/ao_au.c:131:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buf[AU_HEADER_LEN]; data/libao-1.2.2+20180113/src/ao_au.c:202:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buf[4]; data/libao-1.2.2+20180113/src/ao_wav.c:58:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char id[4]; /* RIFF */ data/libao-1.2.2+20180113/src/ao_wav.c:60:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char wave_id[4]; /* WAVE */ data/libao-1.2.2+20180113/src/ao_wav.c:66:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char id[4]; data/libao-1.2.2+20180113/src/ao_wav.c:153:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buf[WAV_HEADER_LEN]; data/libao-1.2.2+20180113/src/ao_wav.c:204: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(buf+46,"\x00\x00\x00\x00\x10\x00\x80\x00\x00\xAA\x00\x38\x9B\x71",14); data/libao-1.2.2+20180113/src/ao_wav.c:236:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buf[4]; /* For holding length values */ data/libao-1.2.2+20180113/src/ao_wmm.c:57: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 mmbuffer[1024]; data/libao-1.2.2+20180113/src/ao_wmm.c:59: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(mmbuffer,"mm:%d ",(int)mmrError); data/libao-1.2.2+20180113/src/ao_wmm.c:575:5: [2] (buffer) CopyMemory: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. CopyMemory((char*)internal->wh[idx].wh.lpData data/libao-1.2.2+20180113/src/audio_out.c:176:24: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!(dt->functions->open)) goto failed; data/libao-1.2.2+20180113/src/audio_out.c:302:13: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fullpath[strlen(AO_PLUGIN_PATH) + 1 + strlen(plugin_dirent->d_name) + 1]; data/libao-1.2.2+20180113/src/audio_out.c:494:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 *)target)[i] = 128; /* 8 bit PCM is unsigned in libao */ data/libao-1.2.2+20180113/src/audio_out.c:770: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(ret[count],p,t-p); data/libao-1.2.2+20180113/src/audio_out.c:826: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 buffer[257]={0}; data/libao-1.2.2+20180113/src/audio_out.c:867: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 buffer[257]={0}; data/libao-1.2.2+20180113/src/audio_out.c:1112:18: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). result = funcs->open(device, &sformat); data/libao-1.2.2+20180113/src/audio_out.c:1381: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(filename, "r"); data/libao-1.2.2+20180113/src/audio_out.c:1390:10: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen(filename, "w"); data/libao-1.2.2+20180113/src/config.c:57:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[LINE_LEN]; data/libao-1.2.2+20180113/src/config.c:60: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 ( !(fp = fopen(config_file, "r")) ) data/libao-1.2.2+20180113/src/config.c:92:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char userfile[FILENAME_MAX+1]; data/libao-1.2.2+20180113/src/plugins/alsa/ao_alsa.c:176:32: [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). internal->id = atoi(value); data/libao-1.2.2+20180113/src/plugins/alsa/ao_alsa.c:181:27: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). internal->buffer_time = atoi(value) * 1000; data/libao-1.2.2+20180113/src/plugins/alsa/ao_alsa.c:183:27: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). internal->period_time = atoi(value); data/libao-1.2.2+20180113/src/plugins/alsa/ao_alsa.c:231: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 pcm_node_name[80]; data/libao-1.2.2+20180113/src/plugins/alsa/ao_alsa.c:655:13: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmp[80]; data/libao-1.2.2+20180113/src/plugins/alsa/ao_alsa.c:656:13: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(tmp,"hw:%d",internal->id); data/libao-1.2.2+20180113/src/plugins/esd/ao_esd.c:63:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char bugbuffer[4096]; data/libao-1.2.2+20180113/src/plugins/esd/ao_esd.c:251: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(internal->bugbuffer + internal->bugfill, output_samples, addto); data/libao-1.2.2+20180113/src/plugins/esd/ao_esd.c:272: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(internal->bugbuffer, output_samples, num_bytes); data/libao-1.2.2+20180113/src/plugins/macosx/ao_macosx.c:157: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(outBuffer,sample,firstFrag); data/libao-1.2.2+20180113/src/plugins/macosx/ao_macosx.c:158: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(outBuffer+firstFrag,internal->buffer,bytesToCopy-firstFrag); data/libao-1.2.2+20180113/src/plugins/macosx/ao_macosx.c:160: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(outBuffer,sample,bytesToCopy); data/libao-1.2.2+20180113/src/plugins/macosx/ao_macosx.c:389:14: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). buffer = atoi(value); data/libao-1.2.2+20180113/src/plugins/macosx/ao_macosx.c:656: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(internal->buffer + firstEmptyByteOffset, output_samples, bytesToCopy); data/libao-1.2.2+20180113/src/plugins/nas/ao_nas.c:127:21: [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 tmp = atoi (value); data/libao-1.2.2+20180113/src/plugins/oss/ao_oss.c:89:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[80]; data/libao-1.2.2+20180113/src/plugins/oss/ao_oss.c:93:11: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf,"/dev/sound/dsp%d",id); data/libao-1.2.2+20180113/src/plugins/oss/ao_oss.c:102:7: [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 = open(*dev_path, O_WRONLY | O_NONBLOCK); data/libao-1.2.2+20180113/src/plugins/oss/ao_oss.c:104:7: [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 = open(*dev_path, O_WRONLY); data/libao-1.2.2+20180113/src/plugins/oss/ao_oss.c:113:19: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf,"/dev/dsp%d",id); data/libao-1.2.2+20180113/src/plugins/oss/ao_oss.c:121:8: [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 = open(*dev_path, O_WRONLY | O_NONBLOCK); data/libao-1.2.2+20180113/src/plugins/oss/ao_oss.c:123:8: [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 = open(*dev_path, O_WRONLY); data/libao-1.2.2+20180113/src/plugins/oss/ao_oss.c:210:24: [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). internal->id=atoi(value); data/libao-1.2.2+20180113/src/plugins/oss/ao_oss.c:213:35: [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). internal->buffer_time = atoi(value) * 1000; data/libao-1.2.2+20180113/src/plugins/oss/ao_oss.c:240:26: [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). internal->fd = open(internal->dev, O_WRONLY); data/libao-1.2.2+20180113/src/plugins/pulse/ao_pulse.c:178:31: [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). internal->buffer_time = atoi(value) * 1000; data/libao-1.2.2+20180113/src/plugins/pulse/ao_pulse.c:239: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(t, "libao"); data/libao-1.2.2+20180113/src/plugins/pulse/ao_pulse.c:240: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(t2, "libao playback stream"); data/libao-1.2.2+20180113/src/plugins/roar/ao_roar.c:222: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 name[80]; data/libao-1.2.2+20180113/src/plugins/roar/ao_roar.c:232:9: [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). ret = atoi(internal->mixer); data/libao-1.2.2+20180113/src/plugins/sndio/ao_sndio.c:97:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). internal->id=atoi(value); data/libao-1.2.2+20180113/src/plugins/sndio/ao_sndio.c:108: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[80]; data/libao-1.2.2+20180113/src/plugins/sndio/ao_sndio.c:109:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf,"sun:%d",internal->id); data/libao-1.2.2+20180113/src/plugins/sun/ao_sun.c:93:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ( (fd = open(dev, O_WRONLY | O_NONBLOCK)) < 0 ) data/libao-1.2.2+20180113/src/plugins/sun/ao_sun.c:148:30: [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). internal->id=atoi(value); data/libao-1.2.2+20180113/src/plugins/sun/ao_sun.c:162:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[80]; data/libao-1.2.2+20180113/src/plugins/sun/ao_sun.c:163:11: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf,"/dev/sound/%d",internal->id); data/libao-1.2.2+20180113/src/plugins/sun/ao_sun.c:167:23: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ( (internal->fd = open(internal->dev, O_WRONLY)) < 0 ) data/libao-1.2.2+20180113/src/ao_au.c:165:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (buf + 24, internal->au.info, 4); data/libao-1.2.2+20180113/src/ao_wav.c:165:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(internal->wave.riff.id, "RIFF",4); data/libao-1.2.2+20180113/src/ao_wav.c:167:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(internal->wave.riff.wave_id, "WAVE",4); data/libao-1.2.2+20180113/src/ao_wav.c:169:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(internal->wave.format.id, "fmt ",4); data/libao-1.2.2+20180113/src/ao_wav.c:185:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(internal->wave.data.id, "data",4); data/libao-1.2.2+20180113/src/ao_wav.c:189:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, internal->wave.riff.id, 4); data/libao-1.2.2+20180113/src/ao_wav.c:191:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf+8, internal->wave.riff.wave_id, 4); data/libao-1.2.2+20180113/src/ao_wav.c:192:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf+12, internal->wave.format.id,4); data/libao-1.2.2+20180113/src/ao_wav.c:205:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf+60, internal->wave.data.id, 4); data/libao-1.2.2+20180113/src/ao_wmm.c:60:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = (int)strlen(mmbuffer); data/libao-1.2.2+20180113/src/audio_out.c:302: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). char fullpath[strlen(AO_PLUGIN_PATH) + 1 + strlen(plugin_dirent->d_name) + 1]; data/libao-1.2.2+20180113/src/audio_out.c:302: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). char fullpath[strlen(AO_PLUGIN_PATH) + 1 + strlen(plugin_dirent->d_name) + 1]; data/libao-1.2.2+20180113/src/audio_out.c:634: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). char *ret = calloc(strlen(matrix)+1,1); /* can only get smaller */ data/libao-1.2.2+20180113/src/audio_out.c:658: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). strlen(mnemonics[m])==t-p){ data/libao-1.2.2+20180113/src/audio_out.c:659:20: [1] (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 character. if(count)strcat(ret,","); data/libao-1.2.2+20180113/src/audio_out.c:701:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(mnemonics[needle])==h-p)break; data/libao-1.2.2+20180113/src/audio_out.c:805:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(map[m])==h-p) data/libao-1.2.2+20180113/src/audio_out.c:835:9: [1] (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 character. strcat(buffer,","); data/libao-1.2.2+20180113/src/audio_out.c:883:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(map[m])==h-p) data/libao-1.2.2+20180113/src/audio_out.c:890:9: [1] (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 character. strcat(buffer,","); data/libao-1.2.2+20180113/src/config.c:45: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). t=p+strlen(p); data/libao-1.2.2+20180113/src/config.c:100:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(homedir) <= FILENAME_MAX - strlen(AO_USER_CONFIG) ) data/libao-1.2.2+20180113/src/config.c:100: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). strlen(homedir) <= FILENAME_MAX - strlen(AO_USER_CONFIG) ) data/libao-1.2.2+20180113/src/config.c:102:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(userfile, homedir, FILENAME_MAX); data/libao-1.2.2+20180113/src/plugins/arts/ao_arts.c:319:7: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(wait); data/libao-1.2.2+20180113/src/plugins/pulse/ao_pulse.c:115:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (fn != p || strlen(p) < allocated - 1) { data/libao-1.2.2+20180113/src/plugins/pulse/ao_pulse.c:226:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (fn != p || strlen(p) < allocated - 1) { ANALYSIS SUMMARY: Hits = 123 Lines analyzed = 8272 in approximately 0.27 seconds (30836 lines/second) Physical Source Lines of Code (SLOC) = 5715 Hits@level = [0] 16 [1] 27 [2] 75 [3] 7 [4] 14 [5] 0 Hits@level+ = [0+] 139 [1+] 123 [2+] 96 [3+] 21 [4+] 14 [5+] 0 Hits/KSLOC@level+ = [0+] 24.322 [1+] 21.5223 [2+] 16.7979 [3+] 3.67454 [4+] 2.44969 [5+] 0 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.