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/hacktv-0+git20200730/acp.c Examining data/hacktv-0+git20200730/acp.h Examining data/hacktv-0+git20200730/common.c Examining data/hacktv-0+git20200730/common.h Examining data/hacktv-0+git20200730/dance.c Examining data/hacktv-0+git20200730/dance.h Examining data/hacktv-0+git20200730/eurocrypt.c Examining data/hacktv-0+git20200730/eurocrypt.h Examining data/hacktv-0+git20200730/ffmpeg.c Examining data/hacktv-0+git20200730/ffmpeg.h Examining data/hacktv-0+git20200730/file.c Examining data/hacktv-0+git20200730/file.h Examining data/hacktv-0+git20200730/fir.c Examining data/hacktv-0+git20200730/fir.h Examining data/hacktv-0+git20200730/fl2k.c Examining data/hacktv-0+git20200730/fl2k.h Examining data/hacktv-0+git20200730/hackrf.c Examining data/hacktv-0+git20200730/hackrf.h Examining data/hacktv-0+git20200730/hacktv.c Examining data/hacktv-0+git20200730/hacktv.h Examining data/hacktv-0+git20200730/mac.c Examining data/hacktv-0+git20200730/mac.h Examining data/hacktv-0+git20200730/nicam728.c Examining data/hacktv-0+git20200730/nicam728.h Examining data/hacktv-0+git20200730/soapysdr.c Examining data/hacktv-0+git20200730/soapysdr.h Examining data/hacktv-0+git20200730/syster.c Examining data/hacktv-0+git20200730/syster.h Examining data/hacktv-0+git20200730/teletext.c Examining data/hacktv-0+git20200730/teletext.h Examining data/hacktv-0+git20200730/test.c Examining data/hacktv-0+git20200730/test.h Examining data/hacktv-0+git20200730/vbidata.c Examining data/hacktv-0+git20200730/vbidata.h Examining data/hacktv-0+git20200730/video.c Examining data/hacktv-0+git20200730/video.h Examining data/hacktv-0+git20200730/videocrypt.c Examining data/hacktv-0+git20200730/videocrypt.h Examining data/hacktv-0+git20200730/videocrypts-sequence.h Examining data/hacktv-0+git20200730/videocrypts.c Examining data/hacktv-0+git20200730/videocrypts.h Examining data/hacktv-0+git20200730/wss.c Examining data/hacktv-0+git20200730/wss.h FINAL RESULTS: data/hacktv-0+git20200730/mac.c:613:2: [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((char *) &pkt[x], _nwo); /* Network Origin string */ data/hacktv-0+git20200730/mac.c:619:2: [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((char *) &pkt[x], _nwname); /* Network Name string */ data/hacktv-0+git20200730/mac.c:688:2: [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((char *) &pkt[x], _sname); data/hacktv-0+git20200730/hacktv.c:398:13: [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((c = getopt_long(argc, argv, "o:m:s:D:G:rvf:al:g:A:t:", long_options, &option_index)) != -1) data/hacktv-0+git20200730/video.c:1703:2: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(time(NULL)); data/hacktv-0+git20200730/dance.c:102:2: [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, tmp, DANCE_FRAME_BYTES - 4); data/hacktv-0+git20200730/dance.c:458:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(s->audio, audio, sizeof(int16_t) * DANCE_AUDIO_LEN * 2); data/hacktv-0+git20200730/eurocrypt.c:204:2: [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(data, pin, 8); data/hacktv-0+git20200730/eurocrypt.c:244:2: [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, in, 8); data/hacktv-0+git20200730/eurocrypt.c:367: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(msg, src + 2, 3); data/hacktv-0+git20200730/eurocrypt.c:371: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(msg + msglen, src + 10, 5); data/hacktv-0+git20200730/eurocrypt.c:375: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(msg + msglen, src + 16, 16); data/hacktv-0+git20200730/eurocrypt.c:381: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(msg, src + 5, 27); data/hacktv-0+git20200730/eurocrypt.c:427:2: [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(&pkt[x], e->mode->ppid, 3); x += 3; data/hacktv-0+git20200730/eurocrypt.c:437:2: [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(&pkt[x], e->mode->cdate, 4); x += 4; data/hacktv-0+git20200730/eurocrypt.c:442:2: [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(&pkt[x], e->ecw[0], 8); x += 8; /* ECW */ data/hacktv-0+git20200730/eurocrypt.c:443:2: [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(&pkt[x], e->ecw[1], 8); x += 8; /* OCW */ data/hacktv-0+git20200730/ffmpeg.c:136: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 sb[128]; data/hacktv-0+git20200730/file.c:315: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). rf->f = fopen(filename, "wb"); data/hacktv-0+git20200730/fl2k.c:137:15: [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). r = device ? atoi(device) : 0; data/hacktv-0+git20200730/hackrf.c:141:2: [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, buf->data + buf->start, length); data/hacktv-0+git20200730/hackrf.c:174:2: [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->data + i, src, length); data/hacktv-0+git20200730/hacktv.c:461: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). s.samplerate = atoi(optarg); data/hacktv-0+git20200730/hacktv.c:559: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). s.gain = atoi(optarg); data/hacktv-0+git20200730/hacktv.c:633:2: [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(&vid_conf, vid_confs->conf, sizeof(vid_config_t)); data/hacktv-0+git20200730/mac.c:443:2: [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(data, p, blocks * 3); data/hacktv-0+git20200730/mac.c:491:2: [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(tmp, pkt, 94); data/hacktv-0+git20200730/mac.c:578:2: [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(pkt, &sf->queue.pkts[x], sizeof(_mac_packet_queue_item_t)); data/hacktv-0+git20200730/mac.c:950:2: [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(sf->queue.pkts[sf->queue.p].pkt, data, MAC_PAYLOAD_BYTES); data/hacktv-0+git20200730/nicam728.c:403:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(s->audio, audio, sizeof(int16_t) * NICAM_AUDIO_LEN * 2); data/hacktv-0+git20200730/syster.c:233:2: [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(&vbi[4][5], &msg2[0], 21); data/hacktv-0+git20200730/syster.c:234:2: [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(&vbi[5][5], &msg2[21], 21); data/hacktv-0+git20200730/syster.c:235:2: [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(&vbi[2][5], &msg2[42], 21); data/hacktv-0+git20200730/syster.c:236:2: [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(&vbi[3][5], &msg2[63], 21); data/hacktv-0+git20200730/syster.c:238:2: [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(&vbi[8][5], &msg1[0], 21); data/hacktv-0+git20200730/syster.c:239:2: [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(&vbi[9][5], &msg1[21], 21); data/hacktv-0+git20200730/syster.c:240:2: [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(&vbi[6][5], &msg1[42], 21); data/hacktv-0+git20200730/syster.c:241:2: [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(&vbi[7][5], &msg1[63], 21); data/hacktv-0+git20200730/syster.c:297:2: [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[2], d, 8); data/hacktv-0+git20200730/syster.c:551:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&msg1[12], emm1, 72); data/hacktv-0+git20200730/syster.c:566:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&msg2[12], emm2, 72); data/hacktv-0+git20200730/teletext.c:182:2: [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(result, tm, sizeof(struct tm)); data/hacktv-0+git20200730/teletext.c:438: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 temp[33]; data/hacktv-0+git20200730/teletext.c:491: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 header[33]; data/hacktv-0+git20200730/teletext.c:538: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(line, &mag->page->data[(mag->row - 1) * 45], 45); data/hacktv-0+git20200730/teletext.c:763:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(subpage, new_page, sizeof(tt_page_t)); data/hacktv-0+git20200730/teletext.c:773: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 buf[200]; data/hacktv-0+git20200730/teletext.c:783:6: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f = fopen(filename, "rb"); data/hacktv-0+git20200730/teletext.c:864:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(page, opage, sizeof(tt_page_t)); data/hacktv-0+git20200730/teletext.c:1089:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). s->raw = fopen(path + 4, "rb"); data/hacktv-0+git20200730/teletext.c:1118: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 filename[PATH_MAX]; data/hacktv-0+git20200730/video.c:1706:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&s->conf, conf, sizeof(vid_config_t)); data/hacktv-0+git20200730/video.c:1825:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&s->colour_lookup[s->colour_lookup_width], s->colour_lookup, s->width * sizeof(int16_t)); data/hacktv-0+git20200730/video.c:2172:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(s->video_filter_taps, s->conf.type == VID_MAC ? fm_mac_taps : fm_taps, taps * sizeof(int16_t)); data/hacktv-0+git20200730/videocrypt.c:165:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(s, r, 8); data/hacktv-0+git20200730/videocrypts.c:149:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(s, r, 8); data/hacktv-0+git20200730/hackrf.c:247:3: [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(100); data/hacktv-0+git20200730/hacktv.c:863: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). l = strlen(pre); data/hacktv-0+git20200730/mac.c:609: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). pkt[x++] = 3 + strlen(_nwo); /* LI Length (bytes, 3 + string length) */ data/hacktv-0+git20200730/mac.c:614: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). x += strlen(_nwo); data/hacktv-0+git20200730/mac.c:618:13: [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). pkt[x++] = strlen(_nwname); /* LI Length (bytes, string length) */ data/hacktv-0+git20200730/mac.c:620: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). x += strlen(_nwname); data/hacktv-0+git20200730/mac.c:686: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). pkt[x++] = 1 + strlen(_sname); /* LI Length */ data/hacktv-0+git20200730/mac.c:689: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). x += strlen(_sname); ANALYSIS SUMMARY: Hits = 64 Lines analyzed = 18548 in approximately 1.29 seconds (14378 lines/second) Physical Source Lines of Code (SLOC) = 13607 Hits@level = [0] 92 [1] 8 [2] 51 [3] 2 [4] 3 [5] 0 Hits@level+ = [0+] 156 [1+] 64 [2+] 56 [3+] 5 [4+] 3 [5+] 0 Hits/KSLOC@level+ = [0+] 11.4647 [1+] 4.70346 [2+] 4.11553 [3+] 0.367458 [4+] 0.220475 [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.