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/imagination-3.6/transitions/diagonal_wipe.c Examining data/imagination-3.6/transitions/box_wipe.c Examining data/imagination-3.6/transitions/barn_door_wipe.c Examining data/imagination-3.6/transitions/clock_wipe.c Examining data/imagination-3.6/transitions/ellipse_wipe.c Examining data/imagination-3.6/transitions/bow_tie_wipe.c Examining data/imagination-3.6/transitions/wave.c Examining data/imagination-3.6/transitions/insert.c Examining data/imagination-3.6/transitions/misc_shape_wipe.c Examining data/imagination-3.6/transitions/four_box_wipe.c Examining data/imagination-3.6/transitions/misc_diagonal_wipe.c Examining data/imagination-3.6/transitions/bar_wipe.c Examining data/imagination-3.6/transitions/push_wipe.c Examining data/imagination-3.6/transitions/misc.c Examining data/imagination-3.6/transitions/rochade.c Examining data/imagination-3.6/src/video_formats.h Examining data/imagination-3.6/src/video_formats.c Examining data/imagination-3.6/src/imgcellrendereranim.h Examining data/imagination-3.6/src/subtitles.h Examining data/imagination-3.6/src/audio.h Examining data/imagination-3.6/src/imgcellrendererpixbuf.h Examining data/imagination-3.6/src/imgcellrendererpixbuf.c Examining data/imagination-3.6/src/main-window.h Examining data/imagination-3.6/src/support.c Examining data/imagination-3.6/src/subtitles.c Examining data/imagination-3.6/src/support.h Examining data/imagination-3.6/src/export.c Examining data/imagination-3.6/src/export.h Examining data/imagination-3.6/src/slideshow_project.h Examining data/imagination-3.6/src/img_sox.h Examining data/imagination-3.6/src/imgcellrendereranim.c Examining data/imagination-3.6/src/new_slideshow.h Examining data/imagination-3.6/src/img_sox.c Examining data/imagination-3.6/src/imagination.c Examining data/imagination-3.6/src/new_slideshow.c Examining data/imagination-3.6/src/main-window.c Examining data/imagination-3.6/src/slideshow_project.c Examining data/imagination-3.6/src/audio.c Examining data/imagination-3.6/src/imagination.h Examining data/imagination-3.6/src/callbacks.c Examining data/imagination-3.6/src/callbacks.h FINAL RESULTS: data/imagination-3.6/src/support.c:1098:31: [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. parsed_message_size = vsnprintf(NULL, 0, message, args); data/imagination-3.6/src/support.c:1107: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(parsed_message, parsed_message_size + 1, message, args); data/imagination-3.6/src/callbacks.c:3193:30: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. rc_path = g_build_filename( g_get_home_dir(), ".config", data/imagination-3.6/src/callbacks.c:3218:30: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. rc_file = g_build_filename( g_get_home_dir(), ".config", data/imagination-3.6/src/export.c:241:33: [3] (buffer) g_get_tmp_dir: This function is synonymous with 'getenv("TMP")';it returns untrustable input if the environment can beset by an attacker. It 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. img->fifo = g_build_filename( g_get_tmp_dir(), "img_audio_fifo", NULL ); data/imagination-3.6/src/main-window.c:2076:7: [3] (random) g_random_int_range: 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. r1 = g_random_int_range( 1, nr ); data/imagination-3.6/src/main-window.c:2082:7: [3] (random) g_random_int_range: 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. r2 = g_random_int_range( 0, nr ); data/imagination-3.6/src/support.c:199:52: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. search_paths[1] = g_build_path(G_DIR_SEPARATOR_S, g_get_home_dir(), ".imagination", data/imagination-3.6/src/support.c:275:31: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. tmp = g_build_filename( g_get_home_dir(), data/imagination-3.6/src/callbacks.c:1561: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(img->g_stop_color, img->current_slide->g_stop_color, 3 * sizeof(gdouble)); data/imagination-3.6/src/export.c:581: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( img->fifo, O_RDONLY ); data/imagination-3.6/src/main-window.c:1635:8: [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(pasted_slide->subtitle, info_slide->subtitle, info_slide->subtitle_length); data/imagination-3.6/src/export.c:582:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while( read( fd, buf, sizeof( buf ) ) ) data/imagination-3.6/src/export.c:1272:56: [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). ok = safe_write( file_desc, header, sizeof( gchar ) * strlen( header ) ); data/imagination-3.6/src/img_sox.c:69:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). size_t read; data/imagination-3.6/src/img_sox.c:74:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if( ! read ) data/imagination-3.6/src/img_sox.c:93:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). *osamp = read; data/imagination-3.6/src/slideshow_project.c:271: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). if( strncmp( dummy, comment_string, strlen( comment_string ) ) != 0 ) data/imagination-3.6/src/subtitles.c:410: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). string[strlen(string) - 2] = '\0'; data/imagination-3.6/src/subtitles.c:412: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). pango_parse_markup(string, strlen(string), 0, NULL, &text, NULL, NULL); data/imagination-3.6/src/subtitles.c:413:43: [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). pango_layout_set_markup(layout, string, strlen(string)); data/imagination-3.6/src/support.c:1313:20: [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). memmove(cursor + strlen(replace), cursor + strlen(search), strlen(cursor) - strlen(search) + 1); data/imagination-3.6/src/support.c:1313:46: [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). memmove(cursor + strlen(replace), cursor + strlen(search), strlen(cursor) - strlen(search) + 1); data/imagination-3.6/src/support.c:1313:62: [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). memmove(cursor + strlen(replace), cursor + strlen(search), strlen(cursor) - strlen(search) + 1); data/imagination-3.6/src/support.c:1313:79: [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). memmove(cursor + strlen(replace), cursor + strlen(search), strlen(cursor) - strlen(search) + 1); data/imagination-3.6/src/support.c:1316:19: [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). cursor += strlen(replace); data/imagination-3.6/src/support.c:1373: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). len = strlen(dummy+7) - strlen(dummy2); data/imagination-3.6/src/support.c:1373:27: [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(dummy+7) - strlen(dummy2); data/imagination-3.6/src/support.c:1377:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(rgb+1, dummy+7, len); data/imagination-3.6/src/support.c:1391: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). len = strlen(dummy+7) - strlen(dummy2); data/imagination-3.6/src/support.c:1391:27: [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(dummy+7) - strlen(dummy2); data/imagination-3.6/src/support.c:1395:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(rgb+1, dummy+7, len); ANALYSIS SUMMARY: Hits = 32 Lines analyzed = 17356 in approximately 2.64 seconds (6570 lines/second) Physical Source Lines of Code (SLOC) = 12955 Hits@level = [0] 5 [1] 20 [2] 3 [3] 7 [4] 2 [5] 0 Hits@level+ = [0+] 37 [1+] 32 [2+] 12 [3+] 9 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 2.85604 [1+] 2.47009 [2+] 0.926283 [3+] 0.694712 [4+] 0.154381 [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.