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/dovecot-fts-xapian-1.3.3/src/fts-backend-xapian-functions.cpp Examining data/dovecot-fts-xapian-1.3.3/src/fts-backend-xapian.cpp Examining data/dovecot-fts-xapian-1.3.3/src/fts-xapian-plugin.c Examining data/dovecot-fts-xapian-1.3.3/src/fts-xapian-plugin.h FINAL RESULTS: data/dovecot-fts-xapian-1.3.3/src/fts-backend-xapian-functions.cpp:624:23: [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). xfe->did[xfe->index]=atoi(argv[0]); data/dovecot-fts-xapian-1.3.3/src/fts-backend-xapian-functions.cpp:625:23: [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). xfe->uid[xfe->index]=atoi(argv[1]); data/dovecot-fts-xapian-1.3.3/src/fts-backend-xapian.cpp:21: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. static const char * hdrs_emails[HDRS_NB] = { "uid", "subject", "from", "to", "cc", "bcc", "messageid", "listid", "body", "" }; data/dovecot-fts-xapian-1.3.3/src/fts-backend-xapian.cpp:22: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. static const char * hdrs_xapian[HDRS_NB] = { "Q", "S", "A", "XTO", "XCC", "XBCC", "XMID", "XLIST", "XBDY", "XBDY" }; data/dovecot-fts-xapian-1.3.3/src/fts-backend-xapian.cpp:114:8: [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). len=atol(*tmp + 8); data/dovecot-fts-xapian-1.3.3/src/fts-backend-xapian.cpp:119:8: [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). len=atol(*tmp + 5); data/dovecot-fts-xapian-1.3.3/src/fts-backend-xapian.cpp:124:8: [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). len=atol(*tmp + 8); data/dovecot-fts-xapian-1.3.3/src/fts-backend-xapian.cpp:129:7: [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). if(atol(*tmp + 12)>0) backend->attachments=true; data/dovecot-fts-xapian-1.3.3/src/fts-backend-xapian-functions.cpp:330:35: [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). hardlimit=XAPIAN_TERM_SIZELIMIT-strlen(prefix); data/dovecot-fts-xapian-1.3.3/src/fts-backend-xapian-functions.cpp:461:31: [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((backend->db == NULL) || (strlen(backend->db)<1)) data/dovecot-fts-xapian-1.3.3/src/fts-backend-xapian-functions.cpp:743:22: [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((mb == NULL) || (strlen(mb)<3)) data/dovecot-fts-xapian-1.3.3/src/fts-backend-xapian-functions.cpp:762:31: [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((backend->db == NULL) || (strlen(backend->db)<1)) data/dovecot-fts-xapian-1.3.3/src/fts-backend-xapian-functions.cpp:817:36: [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((a->hdr_field_name == NULL)||(strlen(a->hdr_field_name)<1)) data/dovecot-fts-xapian-1.3.3/src/fts-backend-xapian-functions.cpp:832:47: [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((a->value.str == NULL) || (strlen(a->value.str)<1)) data/dovecot-fts-xapian-1.3.3/src/fts-backend-xapian-functions.cpp:847:15: [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). long i=0,j=strlen(hdr); data/dovecot-fts-xapian-1.3.3/src/fts-backend-xapian-functions.cpp:908:5: [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(field)<1) { return true; } data/dovecot-fts-xapian-1.3.3/src/fts-backend-xapian-functions.cpp:1027:12: [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). long l = strlen(h); data/dovecot-fts-xapian-1.3.3/src/fts-backend-xapian.cpp:395: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). long i=0,j=strlen(field); ANALYSIS SUMMARY: Hits = 18 Lines analyzed = 1824 in approximately 0.06 seconds (30315 lines/second) Physical Source Lines of Code (SLOC) = 1506 Hits@level = [0] 2 [1] 10 [2] 8 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 20 [1+] 18 [2+] 8 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 13.2802 [1+] 11.9522 [2+] 5.31208 [3+] 0 [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.