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/libdc1394-2.2.6/dc1394/platform.h Examining data/libdc1394-2.2.6/dc1394/macosx.h Examining data/libdc1394-2.2.6/dc1394/macosx/macosx.h Examining data/libdc1394-2.2.6/dc1394/macosx/capture.c Examining data/libdc1394-2.2.6/dc1394/macosx/control.c Examining data/libdc1394-2.2.6/dc1394/conversions.h Examining data/libdc1394-2.2.6/dc1394/format7.h Examining data/libdc1394-2.2.6/dc1394/types.h Examining data/libdc1394-2.2.6/dc1394/bayer.c Examining data/libdc1394-2.2.6/dc1394/juju/juju.h Examining data/libdc1394-2.2.6/dc1394/juju/firewire-constants.h Examining data/libdc1394-2.2.6/dc1394/juju/firewire-cdev.h Examining data/libdc1394-2.2.6/dc1394/juju/capture.c Examining data/libdc1394-2.2.6/dc1394/juju/control.c Examining data/libdc1394-2.2.6/dc1394/utils.h Examining data/libdc1394-2.2.6/dc1394/utils.c Examining data/libdc1394-2.2.6/dc1394/dc1394.h Examining data/libdc1394-2.2.6/dc1394/macosx.c Examining data/libdc1394-2.2.6/dc1394/register.c Examining data/libdc1394-2.2.6/dc1394/usb/capture.c Examining data/libdc1394-2.2.6/dc1394/usb/usb.h Examining data/libdc1394-2.2.6/dc1394/usb/control.c Examining data/libdc1394-2.2.6/dc1394/linux/linux.h Examining data/libdc1394-2.2.6/dc1394/linux/capture.h Examining data/libdc1394-2.2.6/dc1394/linux/control.h Examining data/libdc1394-2.2.6/dc1394/linux/capture.c Examining data/libdc1394-2.2.6/dc1394/linux/control.c Examining data/libdc1394-2.2.6/dc1394/linux/kernel-video1394.h Examining data/libdc1394-2.2.6/dc1394/log.h Examining data/libdc1394-2.2.6/dc1394/enumeration.c Examining data/libdc1394-2.2.6/dc1394/register.h Examining data/libdc1394-2.2.6/dc1394/windows/platform_windows.h Examining data/libdc1394-2.2.6/dc1394/windows/capture.c Examining data/libdc1394-2.2.6/dc1394/windows/control.c Examining data/libdc1394-2.2.6/dc1394/vendor/basler_sff_registry.h Examining data/libdc1394-2.2.6/dc1394/vendor/pixelink.c Examining data/libdc1394-2.2.6/dc1394/vendor/basler_sff_registry.c Examining data/libdc1394-2.2.6/dc1394/vendor/basler.c Examining data/libdc1394-2.2.6/dc1394/vendor/avt.h Examining data/libdc1394-2.2.6/dc1394/vendor/pixelink.h Examining data/libdc1394-2.2.6/dc1394/vendor/basler.h Examining data/libdc1394-2.2.6/dc1394/vendor/avt.c Examining data/libdc1394-2.2.6/dc1394/vendor/basler_sff.h Examining data/libdc1394-2.2.6/dc1394/log.c Examining data/libdc1394-2.2.6/dc1394/internal.h Examining data/libdc1394-2.2.6/dc1394/capture.h Examining data/libdc1394-2.2.6/dc1394/iso.h Examining data/libdc1394-2.2.6/dc1394/conversions.c Examining data/libdc1394-2.2.6/dc1394/control.h Examining data/libdc1394-2.2.6/dc1394/capture.c Examining data/libdc1394-2.2.6/dc1394/offsets.h Examining data/libdc1394-2.2.6/dc1394/internal.c Examining data/libdc1394-2.2.6/dc1394/control.c Examining data/libdc1394-2.2.6/dc1394/format7.c Examining data/libdc1394-2.2.6/dc1394/iso.c Examining data/libdc1394-2.2.6/dc1394/camera.h Examining data/libdc1394-2.2.6/dc1394/video.h Examining data/libdc1394-2.2.6/examples/grab_color_image.c Examining data/libdc1394-2.2.6/examples/grab_partial_pvn.c Examining data/libdc1394-2.2.6/examples/dc1394_iso.c Examining data/libdc1394-2.2.6/examples/affine.h Examining data/libdc1394-2.2.6/examples/basler_sff_extended_data.c Examining data/libdc1394-2.2.6/examples/grab_gray_image.c Examining data/libdc1394-2.2.6/examples/ladybug.c Examining data/libdc1394-2.2.6/examples/dc1394_reset_bus.c Examining data/libdc1394-2.2.6/examples/dc1394_multiview.c Examining data/libdc1394-2.2.6/examples/basler_sff_info.c Examining data/libdc1394-2.2.6/examples/helloworld.c Examining data/libdc1394-2.2.6/examples/grab_partial_image.c Examining data/libdc1394-2.2.6/examples/dc1394_vloopback.c Examining data/libdc1394-2.2.6/examples/affine.c Examining data/libdc1394-2.2.6/examples/grab_color_image2.c Examining data/libdc1394-2.2.6/examples/ladybug5capture.c FINAL RESULTS: data/libdc1394-2.2.6/dc1394/juju/control.c:145: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 (device->filename, filename); data/libdc1394-2.2.6/dc1394/juju/control.c:237: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 (camera->filename, device->filename); data/libdc1394-2.2.6/dc1394/log.c:109:9: [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. vsnprintf(string, sizeof(string), format, args); data/libdc1394-2.2.6/dc1394/log.c:121:9: [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. vsnprintf(string, sizeof(string), format, args); data/libdc1394-2.2.6/dc1394/log.c:133:9: [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. vsnprintf(string, sizeof(string), format, args); data/libdc1394-2.2.6/examples/basler_sff_extended_data.c:95:17: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf (argv[2], "0x%"PRIx64, &guid) == 1) { data/libdc1394-2.2.6/examples/basler_sff_info.c:87:17: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf (argv[2], "0x%"PRIx64, &guid) == 1) { data/libdc1394-2.2.6/examples/dc1394_vloopback.c:125:13: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. sscanf(optarg, "%"PRIx64, &g_guid); data/libdc1394-2.2.6/examples/dc1394_vloopback.c:533:21: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(pipepath, "/dev/%s", input); data/libdc1394-2.2.6/examples/grab_color_image2.c:43:31: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define print_case(A) case A: printf(#A ""); break; data/libdc1394-2.2.6/examples/ladybug.c:129:21: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename,"%s-%05d-%d-%d.jpg",BASENAME,i,cam,k); data/libdc1394-2.2.6/examples/ladybug.c:136:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename,"%s-%05d.raw",BASENAME,i); data/libdc1394-2.2.6/dc1394/linux/control.c:64:31: [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 (!is_device_available (getenv("RAW1394DEV")) && data/libdc1394-2.2.6/dc1394/log.c:45:13: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("DC1394_DEBUG") == NULL ) data/libdc1394-2.2.6/examples/dc1394_multiview.c:109:11: [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. while(getopt_long(argc,argv,"",long_options,&option_index)>=0){ data/libdc1394-2.2.6/examples/dc1394_multiview.c:414:26: [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. display=XOpenDisplay(getenv("DISPLAY")); data/libdc1394-2.2.6/examples/dc1394_multiview.c:416:58: [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. dc1394_log_error("Could not open display \"%s\"",getenv("DISPLAY")); data/libdc1394-2.2.6/examples/dc1394_vloopback.c:115:11: [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. while(getopt_long(argc,argv,"",long_options,&option_index)>=0){ data/libdc1394-2.2.6/dc1394/bayer.c:1960:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (brow[2][col], pix, 3 * sizeof *dst); /* [FD] */ data/libdc1394-2.2.6/dc1394/bayer.c:1984:13: [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 (dst + 3*((row-2)*width+2), brow[0]+2, (width-4)*3*sizeof *dst); /* [FD] */ data/libdc1394-2.2.6/dc1394/bayer.c:1988: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 (dst + 3*((row-2)*width+2), brow[0]+2, (width-4)*3*sizeof *dst); data/libdc1394-2.2.6/dc1394/bayer.c:1989: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 (dst + 3*((row-1)*width+2), brow[1]+2, (width-4)*3*sizeof *dst); data/libdc1394-2.2.6/dc1394/bayer.c:2087:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (brow[2][col], pix, 3 * sizeof *dst); /* [FD] */ data/libdc1394-2.2.6/dc1394/bayer.c:2111:13: [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 (dst + 3*((row-2)*width+2), brow[0]+2, (width-4)*3*sizeof *dst); /* [FD] */ data/libdc1394-2.2.6/dc1394/bayer.c:2115: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 (dst + 3*((row-2)*width+2), brow[0]+2, (width-4)*3*sizeof *dst); data/libdc1394-2.2.6/dc1394/bayer.c:2116: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 (dst + 3*((row-1)*width+2), brow[1]+2, (width-4)*3*sizeof *dst); data/libdc1394-2.2.6/dc1394/bayer.c:2186: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 (*homo)[TS][TS], *buffer; data/libdc1394-2.2.6/dc1394/bayer.c:2254: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. homo = (char (*)[TS][TS]) (buffer + 24*TS*TS); data/libdc1394-2.2.6/dc1394/bayer.c:2360: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 (*homo)[TS][TS], *buffer; data/libdc1394-2.2.6/dc1394/bayer.c:2428: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. homo = (char (*)[TS][TS]) (buffer + 24*TS*TS); data/libdc1394-2.2.6/dc1394/bayer.c:2648: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(&(out->image[out->image_bytes]),&(in->image[in->image_bytes]),out->padding_bytes); data/libdc1394-2.2.6/dc1394/control.c:1906: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(&tempq,&value,4); data/libdc1394-2.2.6/dc1394/conversions.c:44: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(dest,src, (width*height)<<1); data/libdc1394-2.2.6/dc1394/conversions.c:606: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(dest, src, width*height); data/libdc1394-2.2.6/dc1394/conversions.c:642: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(dest, src, width*height*3); data/libdc1394-2.2.6/dc1394/conversions.c:712: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(&(out->image[out->image_bytes]),&(in->image[in->image_bytes]),out->padding_bytes); data/libdc1394-2.2.6/dc1394/conversions.c:807:13: [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(out->image, in->image, in->size[0]*in->size[1]); data/libdc1394-2.2.6/dc1394/conversions.c:871:13: [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(out->image, in->image, in->size[0]*in->size[1]*3); data/libdc1394-2.2.6/dc1394/conversions.c:958: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(&(out->image[out->image_bytes]),&(in->image[in->image_bytes]),out->padding_bytes); data/libdc1394-2.2.6/dc1394/conversions.c:992:13: [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(out->image,in->image,out->image_bytes); data/libdc1394-2.2.6/dc1394/enumeration.c:61: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 (d->cameras + n, info, sizeof (camera_info_t)); data/libdc1394-2.2.6/dc1394/juju/capture.c:50: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 (&f->frame, proto, sizeof f->frame); data/libdc1394-2.2.6/dc1394/juju/capture.c:171:20: [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). craw->iso_fd = open(craw->filename, O_RDWR); data/libdc1394-2.2.6/dc1394/juju/control.c:79: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 filename[32]; data/libdc1394-2.2.6/dc1394/juju/control.c:108: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 filename[262]; data/libdc1394-2.2.6/dc1394/juju/control.c:119:14: [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(filename, O_RDWR); data/libdc1394-2.2.6/dc1394/juju/control.c:178: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 (quads, device->config_rom, *num_quads * sizeof (uint32_t)); data/libdc1394-2.2.6/dc1394/juju/control.c:215: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(device->filename, O_RDWR); data/libdc1394-2.2.6/dc1394/juju/juju.h:48: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 filename[32]; data/libdc1394-2.2.6/dc1394/linux/capture.c:55: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 filename[64]; data/libdc1394-2.2.6/dc1394/linux/capture.c:60:38: [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 ( (craw->capture.dma_fd = open(craw->capture.dma_device_file,O_RDWR)) < 0 ) { data/libdc1394-2.2.6/dc1394/linux/capture.c:69: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(filename,"/dev/video1394/%d",craw->port); data/libdc1394-2.2.6/dc1394/linux/capture.c:72:34: [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). (craw->capture.dma_fd = open(filename,O_RDWR)) >= 0 ) { data/libdc1394-2.2.6/dc1394/linux/capture.c:76: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(filename,"/dev/video1394-%d",craw->port); data/libdc1394-2.2.6/dc1394/linux/capture.c:79:34: [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). (craw->capture.dma_fd = open(filename,O_RDWR)) >= 0 ) { data/libdc1394-2.2.6/dc1394/linux/capture.c:84:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(filename,"/dev/video1394"); data/libdc1394-2.2.6/dc1394/linux/capture.c:87:38: [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). (craw->capture.dma_fd = open(filename,O_RDWR)) >= 0 ) { data/libdc1394-2.2.6/dc1394/linux/capture.c:183:13: [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 (f, craw->capture.frames, sizeof (dc1394video_frame_t)); data/libdc1394-2.2.6/dc1394/linux/capture.c:205: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(craw->capture.dma_device_file,filename,64*sizeof(char)); data/libdc1394-2.2.6/dc1394/linux/control.c:53: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 (filename, O_RDWR); data/libdc1394-2.2.6/dc1394/linux/control.c:194: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 (quads, device->config_rom, *num_quads * sizeof (uint32_t)); data/libdc1394-2.2.6/dc1394/log.c:105: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 string[1024]; data/libdc1394-2.2.6/dc1394/log.c:117: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 string[1024]; data/libdc1394-2.2.6/dc1394/log.c:129: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 string[1024]; data/libdc1394-2.2.6/dc1394/macosx/capture.c:255:13: [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 (frame, capture->frames, sizeof (dc1394video_frame_t)); data/libdc1394-2.2.6/dc1394/usb/capture.c:162: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 (&f->frame, proto, sizeof f->frame); data/libdc1394-2.2.6/dc1394/usb/control.c:183: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[num_quads*4]; data/libdc1394-2.2.6/dc1394/usb/control.c:210: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[num_quads*4]; data/libdc1394-2.2.6/dc1394/utils.c:25: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 *dc1394_feature_desc[DC1394_FEATURE_NUM] = { data/libdc1394-2.2.6/dc1394/utils.c:50: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 *dc1394_error_strings[DC1394_ERROR_NUM] = { data/libdc1394-2.2.6/dc1394/vendor/avt.c:1411:13: [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 + index + (i * 4), &buf_local[i], sizeof(uint32_t)); data/libdc1394-2.2.6/dc1394/vendor/avt.c:1455:13: [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_local[i], buf + index + (i * 4), sizeof(uint32_t)); data/libdc1394-2.2.6/dc1394/vendor/pixelink.c:49: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((void *)i, (void *)&f, sizeof(uint32_t)); data/libdc1394-2.2.6/dc1394/vendor/pixelink.c:70: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((void *)&f, (void *)&i, sizeof(float32_t)); data/libdc1394-2.2.6/dc1394/vendor/pixelink.c:99: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((void *)(str+i), (void *)&quadlet, sizeof(quadlet)); data/libdc1394-2.2.6/dc1394/vendor/pixelink.c:124:23: [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). *serial_num_int = atoi(serial_num); data/libdc1394-2.2.6/dc1394/vendor/pixelink.h:134: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 serial_number[PxL_MAX_STRING_LENGTH]; data/libdc1394-2.2.6/dc1394/vendor/pixelink.h:135: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 description[PxL_MAX_STRING_LENGTH]; data/libdc1394-2.2.6/dc1394/vendor/pixelink.h:144: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[PxL_MAX_STRING_LENGTH]; data/libdc1394-2.2.6/dc1394/windows/capture.c:215:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&craw->capture.frames[i], frame, sizeof (dc1394video_frame_t)); data/libdc1394-2.2.6/dc1394/windows/control.c:130: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 device_path[DEVICE_PATH_SIZE]; data/libdc1394-2.2.6/dc1394/windows/control.c:163: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 device_path[DEVICE_PATH_SIZE]; data/libdc1394-2.2.6/dc1394/windows/control.c:223: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 (quads, device->config_rom, *num_quads * sizeof (uint32_t)); data/libdc1394-2.2.6/dc1394/windows/platform_windows.h:65: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 device_path[DEVICE_PATH_SIZE]; data/libdc1394-2.2.6/examples/dc1394_iso.c:181:16: [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). cam_id=atoi(argv[1]); data/libdc1394-2.2.6/examples/dc1394_multiview.c:117: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). fps=atoi(optarg); data/libdc1394-2.2.6/examples/dc1394_multiview.c:120: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). res=atoi(optarg); data/libdc1394-2.2.6/examples/dc1394_multiview.c:229:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy( frame_buffer + (i * frame_length), data/libdc1394-2.2.6/examples/dc1394_multiview.c:257: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 xv_name[5]; data/libdc1394-2.2.6/examples/dc1394_multiview.c:265:13: [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(xv_name,&formats[j].id,4); data/libdc1394-2.2.6/examples/dc1394_vloopback.c:81:1: [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 ioctlbuf[MAXIOCTL]; data/libdc1394-2.2.6/examples/dc1394_vloopback.c:142:23: [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). g_width = atoi(optarg); data/libdc1394-2.2.6/examples/dc1394_vloopback.c:145: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). g_height = atoi(optarg); data/libdc1394-2.2.6/examples/dc1394_vloopback.c:333:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy( buffer, out_pipe, memsize); data/libdc1394-2.2.6/examples/dc1394_vloopback.c:342:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy( buffer, out_pipe, memsize); data/libdc1394-2.2.6/examples/dc1394_vloopback.c:503: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 pipepath[255]; data/libdc1394-2.2.6/examples/dc1394_vloopback.c:504: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 buffer[255]; data/libdc1394-2.2.6/examples/dc1394_vloopback.c:512: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). vloopbacks=fopen("/proc/video/vloopback/vloopbacks", "r"); data/libdc1394-2.2.6/examples/dc1394_vloopback.c:534: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). pipe=open(pipepath, O_RDWR); data/libdc1394-2.2.6/examples/dc1394_vloopback.c:544:14: [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). pipe=open(device, O_RDWR); data/libdc1394-2.2.6/examples/dc1394_vloopback.c:623: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(vidcap->name, "IEEE 1394 Digital Camera"); data/libdc1394-2.2.6/examples/dc1394_vloopback.c:637: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(vidtune->name, "IEEE 1394 Digital Camera"); data/libdc1394-2.2.6/examples/dc1394_vloopback.c:654:13: [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(vidchan->name, "Dummy channel"); data/libdc1394-2.2.6/examples/dc1394_vloopback.c:842: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(&cmd, ioctlbuf, sizeof(unsigned long int)); data/libdc1394-2.2.6/examples/grab_color_image.c:113: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). imagefile=fopen(IMAGE_FILE_NAME, "wb"); data/libdc1394-2.2.6/examples/grab_color_image2.c:259: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). imagefile=fopen(IMAGE_FILE_NAME, "wb"); data/libdc1394-2.2.6/examples/grab_gray_image.c:162: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). imagefile=fopen(IMAGE_FILE_NAME, "wb"); data/libdc1394-2.2.6/examples/grab_partial_image.c:156: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). imagefile=fopen("Part.pgm","wb"); data/libdc1394-2.2.6/examples/grab_partial_pvn.c:59: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). nimages=atoi(argv[1]); data/libdc1394-2.2.6/examples/grab_partial_pvn.c:113: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). imagefile=fopen(argv[1],"wb"); data/libdc1394-2.2.6/examples/ladybug.c:65: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 filename[256]; data/libdc1394-2.2.6/examples/ladybug.c:130:24: [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). fd=fopen(filename,"w"); data/libdc1394-2.2.6/examples/ladybug.c:137: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). fd=fopen(filename,"w"); data/libdc1394-2.2.6/examples/ladybug5capture.c:113: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 filename[256]; data/libdc1394-2.2.6/examples/ladybug5capture.c:185:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(filename, "%05d.pgm",i); data/libdc1394-2.2.6/examples/ladybug5capture.c:186:21: [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). imagefile = fopen(filename, "wb"); data/libdc1394-2.2.6/dc1394/format7.c:122:13: [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(0); data/libdc1394-2.2.6/dc1394/juju/capture.c:347:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read (craw->iso_fd, &iso, sizeof iso); data/libdc1394-2.2.6/dc1394/juju/control.c:295:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read (cam->fd, &u, sizeof u); data/libdc1394-2.2.6/dc1394/juju/control.c:439:9: [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 (DC1394_SLOW_DOWN); data/libdc1394-2.2.6/dc1394/linux/control.c:97:9: [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 (DC1394_SLOW_DOWN); data/libdc1394-2.2.6/dc1394/linux/control.c:274:9: [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(DC1394_SLOW_DOWN); data/libdc1394-2.2.6/dc1394/linux/control.c:307:9: [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(DC1394_SLOW_DOWN); data/libdc1394-2.2.6/dc1394/macosx/capture.c:637:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read (capture->notify_pipe[0], &ch, 1); data/libdc1394-2.2.6/dc1394/usb/capture.c:451:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (craw->notify_pipe[0], &ch, 1)!=1) { data/libdc1394-2.2.6/dc1394/vendor/avt.c:829:9: [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(50000); data/libdc1394-2.2.6/dc1394/vendor/avt.c:888:9: [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(50000); data/libdc1394-2.2.6/dc1394/windows/control.c:100:9: [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 (DC1394_SLOW_DOWN); data/libdc1394-2.2.6/dc1394/windows/control.c:119:9: [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 (DC1394_SLOW_DOWN); data/libdc1394-2.2.6/dc1394/windows/control.c:183:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(device->device_path, device_path, device_path_size); data/libdc1394-2.2.6/examples/dc1394_vloopback.c:525:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(buffer)>1) { data/libdc1394-2.2.6/examples/dc1394_vloopback.c:526: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). buffer[strlen(buffer)-1]=0; data/libdc1394-2.2.6/examples/dc1394_vloopback.c:840:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). size=read(v4l_dev, ioctlbuf, MAXIOCTL); ANALYSIS SUMMARY: Hits = 133 Lines analyzed = 26048 in approximately 0.74 seconds (35258 lines/second) Physical Source Lines of Code (SLOC) = 17304 Hits@level = [0] 298 [1] 17 [2] 98 [3] 6 [4] 12 [5] 0 Hits@level+ = [0+] 431 [1+] 133 [2+] 116 [3+] 18 [4+] 12 [5+] 0 Hits/KSLOC@level+ = [0+] 24.9075 [1+] 7.68608 [2+] 6.70365 [3+] 1.04022 [4+] 0.693481 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.