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/apsfilter-7.2.6/contrib/okidisplay/okidisplay.c Examining data/apsfilter-7.2.6/contrib/ruslpdrv/lpfont.c Examining data/apsfilter-7.2.6/contrib/ruslpdrv/transfont.c FINAL RESULTS: data/apsfilter-7.2.6/contrib/okidisplay/okidisplay.c:80: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(strcat(buf," "), argv[i]); data/apsfilter-7.2.6/contrib/ruslpdrv/lpfont.c:19: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 chartable[256*6],c; data/apsfilter-7.2.6/contrib/ruslpdrv/lpfont.c:22: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 Packet[90]; /* max string length */ data/apsfilter-7.2.6/contrib/ruslpdrv/lpfont.c:36:9: [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). handle=open(argv[1],O_RDONLY); data/apsfilter-7.2.6/contrib/ruslpdrv/transfont.c:39:12: [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). handle=open(name,O_RDONLY); data/apsfilter-7.2.6/contrib/ruslpdrv/transfont.c:51: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 unsigned buffer[512]; data/apsfilter-7.2.6/contrib/ruslpdrv/transfont.c:59:19: [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 ((handle_f=fopen(name,"rt"))==NULL) data/apsfilter-7.2.6/contrib/ruslpdrv/transfont.c:99: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). FileHandle=open(name,O_WRONLY|O_CREAT,0664); data/apsfilter-7.2.6/contrib/ruslpdrv/transfont.c:105: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 CharTable[256*CHARLEN]; data/apsfilter-7.2.6/contrib/ruslpdrv/transfont.c:106: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 CharTableNew[256*CHARLEN]; data/apsfilter-7.2.6/contrib/ruslpdrv/transfont.c:107: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 TransTable[256]; data/apsfilter-7.2.6/contrib/okidisplay/okidisplay.c:54:38: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (count == 0 && (first[0] = getchar()) != EOF) data/apsfilter-7.2.6/contrib/okidisplay/okidisplay.c:58:22: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((first[1] = getchar()) != EOF) data/apsfilter-7.2.6/contrib/okidisplay/okidisplay.c:78:26: [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). buf = realloc (buf, strlen(buf)+strlen(argv[i])+sizeof(" ")); data/apsfilter-7.2.6/contrib/okidisplay/okidisplay.c:78:38: [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). buf = realloc (buf, strlen(buf)+strlen(argv[i])+sizeof(" ")); data/apsfilter-7.2.6/contrib/okidisplay/okidisplay.c:79:25: [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 (buf != NULL && strlen(argv[i]) > 0) data/apsfilter-7.2.6/contrib/okidisplay/okidisplay.c:80:10: [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(strcat(buf," "), argv[i]); data/apsfilter-7.2.6/contrib/okidisplay/okidisplay.c:93:30: [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). SetWord (&OkiHeader.StrLen, strlen(buf)); data/apsfilter-7.2.6/contrib/okidisplay/okidisplay.c:94:50: [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). fprintf (stdout, "\033/d%dW", sizeof(OkiHeader)+strlen(buf)); data/apsfilter-7.2.6/contrib/okidisplay/okidisplay.c:96: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). fwrite ((void *) buf, strlen(buf), 1, stdout); data/apsfilter-7.2.6/contrib/okidisplay/okidisplay.c:103:17: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((i = getchar()) != EOF) data/apsfilter-7.2.6/contrib/ruslpdrv/lpfont.c:41:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(handle,&chartable[32*6],224*6); data/apsfilter-7.2.6/contrib/ruslpdrv/lpfont.c:48:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). readed=read(0,&c,1); data/apsfilter-7.2.6/contrib/ruslpdrv/transfont.c:44:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(handle,Array,length); ANALYSIS SUMMARY: Hits = 24 Lines analyzed = 302 in approximately 0.07 seconds (4507 lines/second) Physical Source Lines of Code (SLOC) = 236 Hits@level = [0] 8 [1] 13 [2] 10 [3] 0 [4] 1 [5] 0 Hits@level+ = [0+] 32 [1+] 24 [2+] 11 [3+] 1 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 135.593 [1+] 101.695 [2+] 46.6102 [3+] 4.23729 [4+] 4.23729 [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.