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/pixelize-1.0.0/menu.h Examining data/pixelize-1.0.0/display.h Examining data/pixelize-1.0.0/info_popup.c Examining data/pixelize-1.0.0/setup_menu.c Examining data/pixelize-1.0.0/main.c Examining data/pixelize-1.0.0/render.h Examining data/pixelize-1.0.0/help.h Examining data/pixelize-1.0.0/highlight.c Examining data/pixelize-1.0.0/file_dialog.c Examining data/pixelize-1.0.0/cursor.h Examining data/pixelize-1.0.0/status.h Examining data/pixelize-1.0.0/stats.h Examining data/pixelize-1.0.0/file_dialog.h Examining data/pixelize-1.0.0/make_db_imlib2.c Examining data/pixelize-1.0.0/globals.h Examining data/pixelize-1.0.0/highlight.h Examining data/pixelize-1.0.0/options.c Examining data/pixelize-1.0.0/display.c Examining data/pixelize-1.0.0/options.h Examining data/pixelize-1.0.0/find_match.c Examining data/pixelize-1.0.0/help.c Examining data/pixelize-1.0.0/callback_menu.c Examining data/pixelize-1.0.0/status.c Examining data/pixelize-1.0.0/draw_image.c Examining data/pixelize-1.0.0/read_line.h Examining data/pixelize-1.0.0/render_image.h Examining data/pixelize-1.0.0/read_db.h Examining data/pixelize-1.0.0/globals.c Examining data/pixelize-1.0.0/stats.c Examining data/pixelize-1.0.0/read_line.c Examining data/pixelize-1.0.0/render_image.c Examining data/pixelize-1.0.0/render.c Examining data/pixelize-1.0.0/cursor.c Examining data/pixelize-1.0.0/license.h Examining data/pixelize-1.0.0/make_db.c Examining data/pixelize-1.0.0/draw_image.h Examining data/pixelize-1.0.0/read_db.c Examining data/pixelize-1.0.0/info_popup.h Examining data/pixelize-1.0.0/find_match.h FINAL RESULTS: data/pixelize-1.0.0/file_dialog.c:153:4: [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(globals.in_fname, fname); data/pixelize-1.0.0/read_db.c:105: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(db->fname, line); data/pixelize-1.0.0/render.c:363:12: [3] (random) random: 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. hh = random() % nPixH; data/pixelize-1.0.0/render.c:364:12: [3] (random) random: 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. ww = random() % nPixW; data/pixelize-1.0.0/info_popup.c:54:4: [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[64]; data/pixelize-1.0.0/info_popup.c:177:4: [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, "Image coordinates: %dx%d", info_x, info_y); data/pixelize-1.0.0/info_popup.c:200:4: [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 *ary[1]; data/pixelize-1.0.0/make_db.c:59:4: [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 my_cwd[MAX_PATH_LEN+1]; data/pixelize-1.0.0/make_db.c:95: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). if(NULL == (dbfp=fopen("pic_db.dat", "a+"))){ data/pixelize-1.0.0/make_db_imlib2.c:54:4: [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 my_cwd[MAX_PATH_LEN+1]; data/pixelize-1.0.0/make_db_imlib2.c:96: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). if(NULL == (dbfp=fopen("pic_db.dat", "a+"))){ data/pixelize-1.0.0/options.c:43:4: [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[8]; data/pixelize-1.0.0/options.c:181: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(buf, "%d", globals.new_opt.proximity); data/pixelize-1.0.0/options.c:239:4: [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[8]; data/pixelize-1.0.0/options.c:243:7: [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, "%d", im_opt->pixW); data/pixelize-1.0.0/options.c:245:7: [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, "%d", im_opt->pixH); data/pixelize-1.0.0/options.c:247:7: [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, "%d", im_opt->nPixW); data/pixelize-1.0.0/options.c:249:7: [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, "%d", im_opt->nPixH); data/pixelize-1.0.0/read_db.c:72:4: [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[1024]; data/pixelize-1.0.0/read_db.c:75: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). if(NULL == (dbfp=fopen("pic_db.dat", "r"))){ data/pixelize-1.0.0/status.c:74:4: [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[256]; data/pixelize-1.0.0/status.c:77:7: [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, " Size of images: %dx%d", data/pixelize-1.0.0/status.c:80:7: [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, " Number of Images: %dx%d", data/pixelize-1.0.0/file_dialog.c:149:40: [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(NULL == (globals.in_fname=malloc(strlen(fname)+1))){ data/pixelize-1.0.0/read_db.c:29: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). struct PIC_DB *malloc_db(int strlen, int n){ data/pixelize-1.0.0/read_db.c:101: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). len = strlen(line); data/pixelize-1.0.0/read_line.c:29:22: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while(EOF != (c = getc(fp)) && c!='\n'){ ANALYSIS SUMMARY: Hits = 27 Lines analyzed = 4396 in approximately 0.15 seconds (30246 lines/second) Physical Source Lines of Code (SLOC) = 2468 Hits@level = [0] 78 [1] 4 [2] 19 [3] 2 [4] 2 [5] 0 Hits@level+ = [0+] 105 [1+] 27 [2+] 23 [3+] 4 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 42.5446 [1+] 10.94 [2+] 9.31929 [3+] 1.62075 [4+] 0.810373 [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.