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/liblqr-0.4.2/examples/liquidrescale.cpp Examining data/liblqr-0.4.2/examples/liquidrescale-basic.h Examining data/liblqr-0.4.2/examples/liquidrescale.h Examining data/liblqr-0.4.2/examples/liquidrescale-basic.cpp Examining data/liblqr-0.4.2/lqr/lqr_carver_rigmask.c Examining data/liblqr-0.4.2/lqr/lqr_energy_priv.h Examining data/liblqr-0.4.2/lqr/lqr_vmap_list.h Examining data/liblqr-0.4.2/lqr/lqr_gradient.c Examining data/liblqr-0.4.2/lqr/lqr_carver_bias.h Examining data/liblqr-0.4.2/lqr/lqr_rwindow.c Examining data/liblqr-0.4.2/lqr/lqr_cursor.h Examining data/liblqr-0.4.2/lqr/lqr_carver_rigmask_pub.h Examining data/liblqr-0.4.2/lqr/lqr_vmap.h Examining data/liblqr-0.4.2/lqr/lqr_carver_pub.h Examining data/liblqr-0.4.2/lqr/lqr_progress.h Examining data/liblqr-0.4.2/lqr/lqr_rwindow.h Examining data/liblqr-0.4.2/lqr/lqr_carver_priv.h Examining data/liblqr-0.4.2/lqr/lqr_vmap_pub.h Examining data/liblqr-0.4.2/lqr/lqr_carver_macros_priv.h Examining data/liblqr-0.4.2/lqr/lqr_carver.h Examining data/liblqr-0.4.2/lqr/lqr_carver_list.c Examining data/liblqr-0.4.2/lqr/lqr_vmap_list_pub.h Examining data/liblqr-0.4.2/lqr/lqr_cursor_priv.h Examining data/liblqr-0.4.2/lqr/lqr_carver_list.h Examining data/liblqr-0.4.2/lqr/lqr_carver_list_priv.h Examining data/liblqr-0.4.2/lqr/lqr_progress_pub.h Examining data/liblqr-0.4.2/lqr/lqr_vmap_list_priv.h Examining data/liblqr-0.4.2/lqr/lqr_base.h Examining data/liblqr-0.4.2/lqr/lqr_progress_priv.h Examining data/liblqr-0.4.2/lqr/lqr_gradient_pub.h Examining data/liblqr-0.4.2/lqr/lqr_carver_rigmask.h Examining data/liblqr-0.4.2/lqr/lqr_carver_list_pub.h Examining data/liblqr-0.4.2/lqr/lqr_carver_rigmask_priv.h Examining data/liblqr-0.4.2/lqr/lqr_gradient_priv.h Examining data/liblqr-0.4.2/lqr/lqr_cursor_pub.h Examining data/liblqr-0.4.2/lqr/lqr_carver_bias_priv.h Examining data/liblqr-0.4.2/lqr/lqr_gradient.h Examining data/liblqr-0.4.2/lqr/lqr_carver.c Examining data/liblqr-0.4.2/lqr/lqr_rwindow_priv.h Examining data/liblqr-0.4.2/lqr/lqr_energy.c Examining data/liblqr-0.4.2/lqr/lqr.h Examining data/liblqr-0.4.2/lqr/lqr_vmap.c Examining data/liblqr-0.4.2/lqr/lqr_vmap_list.c Examining data/liblqr-0.4.2/lqr/lqr_rwindow_pub.h Examining data/liblqr-0.4.2/lqr/lqr_progress.c Examining data/liblqr-0.4.2/lqr/lqr_cursor.c Examining data/liblqr-0.4.2/lqr/lqr_energy.h Examining data/liblqr-0.4.2/lqr/lqr_carver_bias_pub.h Examining data/liblqr-0.4.2/lqr/lqr_carver_bias.c Examining data/liblqr-0.4.2/lqr/lqr_all.h Examining data/liblqr-0.4.2/lqr/lqr_energy_pub.h Examining data/liblqr-0.4.2/lqr/lqr_vmap_priv.h FINAL RESULTS: data/liblqr-0.4.2/examples/liquidrescale-basic.cpp:120:17: [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, "f:,o:,w:,h:,r:,s:", lopts, &i)) != EOF) { data/liblqr-0.4.2/examples/liquidrescale.cpp:420: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. getopt_long(argc, argv, "f:,o:,w:,h:,r:,s:,p:,P:,z:,d:,D:,x:,k:,K:,v:,V:,t,n:,e:,E:,W:,H:,q", lopts, data/liblqr-0.4.2/examples/liquidrescale-basic.cpp:129:29: [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). new_width = atoi(optarg); data/liblqr-0.4.2/examples/liquidrescale-basic.cpp:132:30: [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). new_height = atoi(optarg); data/liblqr-0.4.2/examples/liquidrescale-basic.cpp:138:28: [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). max_step = atoi(optarg); data/liblqr-0.4.2/examples/liquidrescale.cpp:433:33: [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). new_width = atoi(optarg); data/liblqr-0.4.2/examples/liquidrescale.cpp:441:34: [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). new_height = atoi(optarg); data/liblqr-0.4.2/examples/liquidrescale.cpp:449:28: [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). max_step = atoi(optarg); data/liblqr-0.4.2/examples/liquidrescale.cpp:458:33: [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). pres_strength = atoi(optarg); data/liblqr-0.4.2/examples/liquidrescale.cpp:467:33: [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). disc_strength = atoi(optarg); data/liblqr-0.4.2/examples/liquidrescale.cpp:485:41: [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). side_switch_frequency = atoi(optarg); data/liblqr-0.4.2/examples/liquidrescale.cpp:904:17: [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 ((sink = fopen(name, "wb")) == NULL) { data/liblqr-0.4.2/examples/liquidrescale.cpp:968:26: [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). CHECK_OR_N(((input = fopen(name, "rb")) != NULL), "can't open vmap file"); data/liblqr-0.4.2/examples/liquidrescale.cpp:1015:17: [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). w = atoi(read_buffer); data/liblqr-0.4.2/examples/liquidrescale.cpp:1018:17: [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). h = atoi(read_buffer); data/liblqr-0.4.2/examples/liquidrescale.cpp:1021:21: [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). depth = atoi(read_buffer); data/liblqr-0.4.2/examples/liquidrescale.cpp:1024:27: [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). orientation = atoi(read_buffer); data/liblqr-0.4.2/examples/liquidrescale.cpp:430:28: [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 (optarg[strlen(optarg) - 1] == '%') { data/liblqr-0.4.2/examples/liquidrescale.cpp:438:28: [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 (optarg[strlen(optarg) - 1] == '%') { data/liblqr-0.4.2/examples/liquidrescale.cpp:978:25: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). CHECK_OR_N((c = getc(input)) != EOF, "corrupted vmap header"); data/liblqr-0.4.2/examples/liquidrescale.cpp:990:22: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (((c = getc(input)) != EOF) && (i < RBS)) { data/liblqr-0.4.2/examples/liquidrescale.cpp:1003:22: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (((c = getc(input)) != EOF) && (i < RBS)) { data/liblqr-0.4.2/examples/liquidrescale.cpp:1047:29: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((y < h) && ((c = getc(input)) != EOF)) { ANALYSIS SUMMARY: Hits = 23 Lines analyzed = 8317 in approximately 0.29 seconds (28818 lines/second) Physical Source Lines of Code (SLOC) = 5436 Hits@level = [0] 40 [1] 6 [2] 15 [3] 2 [4] 0 [5] 0 Hits@level+ = [0+] 63 [1+] 23 [2+] 17 [3+] 2 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 11.5894 [1+] 4.23105 [2+] 3.1273 [3+] 0.367918 [4+] 0 [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.