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/kannel-sqlbox-0.7.2/gw/sqlbox_sql.h Examining data/kannel-sqlbox-0.7.2/gw/sqlbox_oracle.c Examining data/kannel-sqlbox-0.7.2/gw/sqlbox_mysql.c Examining data/kannel-sqlbox-0.7.2/gw/sqlbox.c Examining data/kannel-sqlbox-0.7.2/gw/sqlbox_sqlite.c Examining data/kannel-sqlbox-0.7.2/gw/sqlbox_mssql.c Examining data/kannel-sqlbox-0.7.2/gw/sqlbox_sdb.c Examining data/kannel-sqlbox-0.7.2/gw/sqlbox_pgsql.c Examining data/kannel-sqlbox-0.7.2/gw/sqlbox_mssql.h Examining data/kannel-sqlbox-0.7.2/gw/sqlbox_mysql.h Examining data/kannel-sqlbox-0.7.2/gw/sqlbox_oracle.h Examining data/kannel-sqlbox-0.7.2/gw/sqlbox_pgsql.h Examining data/kannel-sqlbox-0.7.2/gw/sqlbox_sdb.h Examining data/kannel-sqlbox-0.7.2/gw/sqlbox_sqlite3.h Examining data/kannel-sqlbox-0.7.2/gw/sqlbox_sqlite.h Examining data/kannel-sqlbox-0.7.2/gw/sqlbox_sqlite3.c Examining data/kannel-sqlbox-0.7.2/gw/sqlbox_sql.c FINAL RESULTS: data/kannel-sqlbox-0.7.2/gw/sqlbox.c:761:9: [4] (shell) execvp: 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. execvp(argv[0], argv); data/kannel-sqlbox-0.7.2/gw/sqlbox_pgsql.c:40:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(tmp, " host=%s", octstr_get_cstr(conf->host)); data/kannel-sqlbox-0.7.2/gw/sqlbox_pgsql.c:41:22: [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). if (strlen(tmp)) strcat(cs, tmp); data/kannel-sqlbox-0.7.2/gw/sqlbox_pgsql.c:43:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(tmp, " user=%s", octstr_get_cstr(conf->username)); data/kannel-sqlbox-0.7.2/gw/sqlbox_pgsql.c:44:22: [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). if (strlen(tmp)) strcat(cs, tmp); data/kannel-sqlbox-0.7.2/gw/sqlbox_pgsql.c:46:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(tmp, " password=%s", octstr_get_cstr(conf->password)); data/kannel-sqlbox-0.7.2/gw/sqlbox_pgsql.c:47:22: [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). if (strlen(tmp)) strcat(cs, tmp); data/kannel-sqlbox-0.7.2/gw/sqlbox_pgsql.c:49:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(tmp, " dbname=%s", octstr_get_cstr(conf->database)); data/kannel-sqlbox-0.7.2/gw/sqlbox_pgsql.c:50:22: [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). if (strlen(tmp)) strcat(cs, tmp); data/kannel-sqlbox-0.7.2/gw/sqlbox_mssql.c:94:37: [2] (integer) atol: 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). #define atol_null(x) ((x != NULL) ? atol(x) : -1) data/kannel-sqlbox-0.7.2/gw/sqlbox_mssql.c:96:32: [2] (integer) atol: 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). #define get_mssql_long_col(x) (atol(octstr_get_cstr(gwlist_get(row,x)))) data/kannel-sqlbox-0.7.2/gw/sqlbox_mysql.c:98:37: [2] (integer) atol: 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). #define atol_null(x) ((x != NULL) ? atol(x) : -1) data/kannel-sqlbox-0.7.2/gw/sqlbox_oracle.c:95:37: [2] (integer) atol: 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). #define atol_null(x) ((x != NULL) ? atol(x) : -1) data/kannel-sqlbox-0.7.2/gw/sqlbox_oracle.c:97:33: [2] (integer) atol: 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). #define get_oracle_long_col(x) (atol(octstr_get_cstr(gwlist_get(row,x)))) data/kannel-sqlbox-0.7.2/gw/sqlbox_pgsql.c:31: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 tmp[1024]; data/kannel-sqlbox-0.7.2/gw/sqlbox_pgsql.c:32: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 cs[1024]; data/kannel-sqlbox-0.7.2/gw/sqlbox_pgsql.c:221:57: [2] (integer) atol: 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). #define atol_null(x) ((PQgetvalue(res, 0, x) != NULL) ? atol(PQgetvalue(res, 0, x)) : -1) data/kannel-sqlbox-0.7.2/gw/sqlbox_sdb.c:43:37: [2] (integer) atol: 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). #define atol_null(x) ((x != NULL) ? atol(x) : -1) data/kannel-sqlbox-0.7.2/gw/sqlbox_sdb.c:45:30: [2] (integer) atol: 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). #define get_sdb_long_col(x) (atol(octstr_get_cstr(gwlist_get(row,x)))) data/kannel-sqlbox-0.7.2/gw/sqlbox_sqlite.c:27:37: [2] (integer) atol: 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). #define atol_null(x) ((x != NULL) ? atol(x) : -1) data/kannel-sqlbox-0.7.2/gw/sqlbox_sqlite3.c:27:37: [2] (integer) atol: 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). #define atol_null(x) ((x != NULL) ? atol(x) : -1) data/kannel-sqlbox-0.7.2/gw/sqlbox_pgsql.c:41: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). if (strlen(tmp)) strcat(cs, tmp); data/kannel-sqlbox-0.7.2/gw/sqlbox_pgsql.c:44: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). if (strlen(tmp)) strcat(cs, tmp); data/kannel-sqlbox-0.7.2/gw/sqlbox_pgsql.c:47: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). if (strlen(tmp)) strcat(cs, tmp); data/kannel-sqlbox-0.7.2/gw/sqlbox_pgsql.c:50: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). if (strlen(tmp)) strcat(cs, tmp); ANALYSIS SUMMARY: Hits = 25 Lines analyzed = 3620 in approximately 1.32 seconds (2739 lines/second) Physical Source Lines of Code (SLOC) = 2577 Hits@level = [0] 0 [1] 4 [2] 12 [3] 0 [4] 9 [5] 0 Hits@level+ = [0+] 25 [1+] 25 [2+] 21 [3+] 9 [4+] 9 [5+] 0 Hits/KSLOC@level+ = [0+] 9.7012 [1+] 9.7012 [2+] 8.14901 [3+] 3.49243 [4+] 3.49243 [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.