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/libirman-0.5.2/irio.c Examining data/libirman-0.5.2/chunk.c Examining data/libirman-0.5.2/test_name.c Examining data/libirman-0.5.2/ircmd.c Examining data/libirman-0.5.2/lirc-plugin/irman.c Examining data/libirman-0.5.2/test_io.c Examining data/libirman-0.5.2/chunk.h Examining data/libirman-0.5.2/workmanir.c Examining data/libirman-0.5.2/hashtable.c Examining data/libirman-0.5.2/irfunc.c Examining data/libirman-0.5.2/test_func.c Examining data/libirman-0.5.2/hashtable.h Examining data/libirman-0.5.2/irman.h FINAL RESULTS: data/libirman-0.5.2/ircmd.c:80:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(ne->name, name); data/libirman-0.5.2/ircmd.c:137:7: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(rcname, home); data/libirman-0.5.2/ircmd.c:139:7: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(rcname + hl+1, IR_USER_IRMANRC); data/libirman-0.5.2/ircmd.c:484:5: [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. printf(IR_ASK_GREETING, name); data/libirman-0.5.2/ircmd.c:492:5: [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. printf(IR_ASK_REPEAT, name); data/libirman-0.5.2/ircmd.c:499:7: [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. printf(IR_ASK_NOMATCH); data/libirman-0.5.2/ircmd.c:501:7: [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. printf(IR_ASK_OK); data/libirman-0.5.2/workmanir.c:110:7: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(arg, str); data/libirman-0.5.2/workmanir.c:111:11: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (system(buf) != 0) { data/libirman-0.5.2/ircmd.c:127:12: [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. home = getenv("HOME"); data/libirman-0.5.2/ircmd.c:34: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 text[IR_CODE_LEN * 2 + 1]; data/libirman-0.5.2/ircmd.c:51:8: [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 irmanrc_portname[IR_PORTNAME_LEN]; data/libirman-0.5.2/ircmd.c:103: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 buf[999]; data/libirman-0.5.2/ircmd.c:122: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). rc = fopen(rcname, "r"); data/libirman-0.5.2/ircmd.c:142: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). rc = fopen(rcname, "r"); data/libirman-0.5.2/ircmd.c:144: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). rc = fopen(IR_SYSTEM_IRMANRC, "r"); data/libirman-0.5.2/ircmd.c:481:12: [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 codecpy[IR_CODE_LEN]; data/libirman-0.5.2/ircmd.c:490: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(codecpy, code, IR_CODE_LEN); data/libirman-0.5.2/irfunc.c:35:8: [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 ir_hexdigit[16] = { data/libirman-0.5.2/irfunc.c:137: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 codebuf[2][IR_CODE_LEN]; data/libirman-0.5.2/irfunc.c:180:20: [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. return (unsigned char *) codebuf[1-curbuf]; data/libirman-0.5.2/irfunc.c:187: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 buf[999]; data/libirman-0.5.2/irfunc.c:242: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 text[2 * IR_CODE_LEN + 1]; data/libirman-0.5.2/irfunc.c:273: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 code[IR_CODE_LEN]; data/libirman-0.5.2/irio.c:89:15: [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 ((portfd=open(filename, O_RDWR | O_NOCTTY | O_NDELAY)) < 0) { data/libirman-0.5.2/workmanir.c:76:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[999]; data/libirman-0.5.2/workmanir.c:81:3: [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(buf, "workman -s "); data/libirman-0.5.2/ircmd.c:60:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(te->text, text, IR_CODE_LEN * 2); data/libirman-0.5.2/ircmd.c:78: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). ne->name = ch_malloc(strlen(name) + 1, stuff); data/libirman-0.5.2/ircmd.c:131: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). hl = strlen(home); data/libirman-0.5.2/ircmd.c:132: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). rl = strlen(IR_USER_IRMANRC); data/libirman-0.5.2/ircmd.c:206: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). if (strlen(q) > IR_PORTNAME_LEN - 1) { data/libirman-0.5.2/ircmd.c:211:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(irmanrc_portname, q, IR_PORTNAME_LEN); data/libirman-0.5.2/irfunc.c:229: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). if (strlen(text) != IR_CODE_LEN * 2) data/libirman-0.5.2/irio.c:297:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ok = read(portfd, &rdchar, 1); data/libirman-0.5.2/workmanir.c:67:5: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(0); data/libirman-0.5.2/workmanir.c:82:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). arg = buf + strlen(buf); ANALYSIS SUMMARY: Hits = 37 Lines analyzed = 2293 in approximately 0.08 seconds (28304 lines/second) Physical Source Lines of Code (SLOC) = 1541 Hits@level = [0] 53 [1] 10 [2] 17 [3] 1 [4] 9 [5] 0 Hits@level+ = [0+] 90 [1+] 37 [2+] 27 [3+] 10 [4+] 9 [5+] 0 Hits/KSLOC@level+ = [0+] 58.4036 [1+] 24.0104 [2+] 17.5211 [3+] 6.48929 [4+] 5.84036 [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.