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/lloconv-6.1.0/convert.cc Examining data/lloconv-6.1.0/urlencode.h Examining data/lloconv-6.1.0/convert.h Examining data/lloconv-6.1.0/inject-meta.cc Examining data/lloconv-6.1.0/urlencode.cc Examining data/lloconv-6.1.0/lloconv.cc FINAL RESULTS: data/lloconv-6.1.0/inject-meta.cc:127:5: [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(dir_template, p); data/lloconv-6.1.0/inject-meta.cc:128:5: [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). strcat(dir_template, TEMP_DIR_TEMPLATE); data/lloconv-6.1.0/inject-meta.cc:149:13: [4] (shell) popen: 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. FILE * f = popen("unzip -p tmp.odt meta.xml", "r"); data/lloconv-6.1.0/inject-meta.cc:208:10: [4] (shell) system: 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. int r = system("zip tmp.odt meta.xml"); data/lloconv-6.1.0/lloconv.cc:184:5: [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(my_addr.sun_path, socket_path); data/lloconv-6.1.0/lloconv.cc:363:2: [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(my_addr.sun_path, socket_path); data/lloconv-6.1.0/convert.cc:42:28: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They 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. const char * lo_path = getenv("LO_PATH"); data/lloconv-6.1.0/inject-meta.cc:124:22: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They 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. const char * p = getenv("TMPDIR"); data/lloconv-6.1.0/inject-meta.cc:140:15: [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). int cwd_fd = open(".", O_RDONLY); data/lloconv-6.1.0/inject-meta.cc:155:15: [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). FILE * out = fopen("meta.xml", "w"); data/lloconv-6.1.0/lloconv.cc:101: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 buf[5]; data/lloconv-6.1.0/lloconv.cc:155:13: [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). int r = atoi(v); data/lloconv-6.1.0/lloconv.cc:163: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 buf[32]; data/lloconv-6.1.0/lloconv.cc:164:5: [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", v); data/lloconv-6.1.0/inject-meta.cc:126:64: [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). char * dir_template = new char[sizeof(TEMP_DIR_TEMPLATE) + strlen(p)]; data/lloconv-6.1.0/lloconv.cc:52:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, &ch, 1) != 1) return false; data/lloconv-6.1.0/lloconv.cc:58:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, &ch, 1) != 1) return false; data/lloconv-6.1.0/lloconv.cc:69:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t n = read(fd, p, len); data/lloconv-6.1.0/lloconv.cc:180: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(socket_path) >= sizeof(my_addr.sun_path)) { data/lloconv-6.1.0/lloconv.cc:359:6: [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(socket_path) >= sizeof(my_addr.sun_path)) { data/lloconv-6.1.0/urlencode.h:44: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). url_encode_(res, p, std::strlen(p), "-._~"); data/lloconv-6.1.0/urlencode.h:58: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). url_encode_(res, p, std::strlen(p), "/-._~"); ANALYSIS SUMMARY: Hits = 22 Lines analyzed = 890 in approximately 0.04 seconds (20693 lines/second) Physical Source Lines of Code (SLOC) = 687 Hits@level = [0] 4 [1] 8 [2] 6 [3] 2 [4] 6 [5] 0 Hits@level+ = [0+] 26 [1+] 22 [2+] 14 [3+] 8 [4+] 6 [5+] 0 Hits/KSLOC@level+ = [0+] 37.8457 [1+] 32.0233 [2+] 20.3785 [3+] 11.6448 [4+] 8.73362 [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.