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/qiv-2.3.2/event.c Examining data/qiv-2.3.2/qiv.h Examining data/qiv-2.3.2/qiv_icon.h Examining data/qiv-2.3.2/main.c Examining data/qiv-2.3.2/main.h Examining data/qiv-2.3.2/xmalloc.c Examining data/qiv-2.3.2/options.c Examining data/qiv-2.3.2/xmalloc.h Examining data/qiv-2.3.2/utils.c Examining data/qiv-2.3.2/image.c Examining data/qiv-2.3.2/lib/getopt.c Examining data/qiv-2.3.2/lib/getopt1.c Examining data/qiv-2.3.2/lib/getopt.h FINAL RESULTS: data/qiv-2.3.2/event.c:499:13: [4] (format) snprintf: 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. snprintf(infotext, sizeof infotext, center ? data/qiv-2.3.2/event.c:531:13: [4] (format) snprintf: 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. snprintf(infotext, sizeof infotext, transparency ? data/qiv-2.3.2/event.c:541:13: [4] (format) snprintf: 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. snprintf(infotext, sizeof infotext, maxpect ? data/qiv-2.3.2/event.c:552:13: [4] (format) snprintf: 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. snprintf(infotext, sizeof infotext, random_order ? data/qiv-2.3.2/event.c:579:15: [4] (format) snprintf: 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. snprintf(infotext, sizeof infotext, statusbar_fullscreen ? data/qiv-2.3.2/event.c:583:15: [4] (format) snprintf: 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. snprintf(infotext, sizeof infotext, statusbar_window ? data/qiv-2.3.2/event.c:594:13: [4] (format) snprintf: 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. snprintf(infotext, sizeof infotext, comment_window ? data/qiv-2.3.2/event.c:608:13: [4] (format) snprintf: 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. snprintf(infotext, sizeof infotext, slide ? data/qiv-2.3.2/event.c:702:13: [4] (format) snprintf: 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. snprintf(infotext, sizeof infotext, scale_down ? data/qiv-2.3.2/event.c:935:13: [4] (format) snprintf: 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. snprintf(infotext, sizeof infotext, watch_file ? data/qiv-2.3.2/options.c:411:13: [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(tmp+2,image_names[0]); data/qiv-2.3.2/options.c:414:13: [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(tmp,image_names[0]); data/qiv-2.3.2/utils.c:76:8: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if(access(ptr2,F_OK)) { data/qiv-2.3.2/utils.c:319:5: [4] (shell) execlp: 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. execlp("qiv-command", "qiv-command", nr, filename, NULL); data/qiv-2.3.2/lib/getopt.c:215:7: [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. char *getenv (); data/qiv-2.3.2/lib/getopt.c:367:21: [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. posixly_correct = getenv ("POSIXLY_CORRECT"); data/qiv-2.3.2/lib/getopt.c:396:25: [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. nonoption_flags = getenv (var); data/qiv-2.3.2/lib/getopt.c:919:1: [3] (buffer) getopt: 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 (argc, argv, optstring) data/qiv-2.3.2/lib/getopt.c:949:11: [3] (buffer) getopt: 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. c = getopt (argc, argv, "abc:d:0123456789"); data/qiv-2.3.2/lib/getopt.h:106:12: [3] (buffer) getopt: 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. extern int getopt (int argc, char *const *argv, const char *shortopts); data/qiv-2.3.2/lib/getopt.h:108:12: [3] (buffer) getopt: 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. extern int getopt (); data/qiv-2.3.2/lib/getopt.h:110:12: [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. extern int getopt_long (int argc, char *const *argv, const char *shortopts, data/qiv-2.3.2/lib/getopt.h:122:12: [3] (buffer) getopt: 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. extern int getopt (); data/qiv-2.3.2/lib/getopt.h:123:12: [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. extern int getopt_long (); data/qiv-2.3.2/lib/getopt1.c:68:1: [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, options, long_options, opt_index) data/qiv-2.3.2/lib/getopt1.c:124:11: [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. c = getopt_long (argc, argv, "abc:d:0123456789", data/qiv-2.3.2/main.c:60:3: [3] (random) srand: 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. srand(tv.tv_usec*1000000+tv.tv_sec); data/qiv-2.3.2/options.c:238:15: [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, short_options, data/qiv-2.3.2/utils.c:54:9: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if(!realpath(filename,path_result)) { data/qiv-2.3.2/event.c:21:8: [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 char jcmd[100]; data/qiv-2.3.2/event.c:176:9: [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. const char *mess[2]={ jcmd, NULL}; data/qiv-2.3.2/lib/getopt.c:394:7: [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 var[100]; data/qiv-2.3.2/lib/getopt.c:395:7: [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 (var, "_%d_GNU_nonoption_argv_flags_", getpid ()); data/qiv-2.3.2/main.h:5:1: [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 infotext[BUF_LEN]; data/qiv-2.3.2/main.h:25:1: [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 select_dir[FILENAME_LEN]; data/qiv-2.3.2/options.c:90:17: [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 unsigned char casemap[256] = { data/qiv-2.3.2/options.c:180: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). long val = atol((char *)cp1) - atol((char *)cp2); data/qiv-2.3.2/options.c:180:52: [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). long val = atol((char *)cp1) - atol((char *)cp2); data/qiv-2.3.2/options.c:407:22: [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 = (char *)xmalloc(strlen(image_names[0])+3); data/qiv-2.3.2/qiv.h:102:8: [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. extern char infotext[BUF_LEN]; data/qiv-2.3.2/qiv.h:122:8: [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. extern char select_dir[FILENAME_LEN]; data/qiv-2.3.2/utils.c:40:3: [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 trashfile[FILENAME_LEN], path_result[PATH_MAX]; data/qiv-2.3.2/utils.c:160:3: [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 dstfile[FILENAME_LEN], dstfilebak[FILENAME_LEN], tmp[FILENAME_LEN], buf[BUFSIZ]; data/qiv-2.3.2/utils.c:165:11: [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). if((n = open(dstfile, O_CREAT, 0666)) == -1) { data/qiv-2.3.2/utils.c:201:16: [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). while ((n2 = open(dstfilebak, O_RDONLY)) != -1) { data/qiv-2.3.2/utils.c:213:9: [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). fdi = open(filename, O_RDONLY); data/qiv-2.3.2/utils.c:214:9: [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). fdo = open(dstfile, O_CREAT | O_WRONLY, 0666); data/qiv-2.3.2/utils.c:283:10: [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 char nr[100]; data/qiv-2.3.2/utils.c:285:16: [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 *lines[MAXLINES + 1]; data/qiv-2.3.2/utils.c:417:7: [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). x = atoi(cmd+1); data/qiv-2.3.2/utils.c:627:3: [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 cdirname[FILENAME_LEN], name[FILENAME_LEN]; data/qiv-2.3.2/utils.c:672:23: [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). fp = fopen(filename, "r"); data/qiv-2.3.2/utils.c:683:3: [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 line[ BUFSIZ ]; data/qiv-2.3.2/utils.c:786:12: [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. unsigned char pic_tst[4]; data/qiv-2.3.2/utils.c:813: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 ((infile = fopen(filename, "rb")) == NULL) data/qiv-2.3.2/utils.c:904:9: [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(icc_ptr+length+sizeof(length), tag_ptr[j], tag_length[j]); data/qiv-2.3.2/utils.c:929:7: [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(icc_ptr+sizeof(length), data, length); data/qiv-2.3.2/utils.c:948:3: [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 buffer[256]; data/qiv-2.3.2/image.c:767:17: [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). q->text_len = strlen(q->win_title); data/qiv-2.3.2/lib/getopt.c:239: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). extern int strlen (const char *); data/qiv-2.3.2/lib/getopt.c:400:24: [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). nonoption_flags_len = strlen (nonoption_flags); data/qiv-2.3.2/lib/getopt.c:608:21: [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). == (unsigned int) strlen (p->name)) data/qiv-2.3.2/lib/getopt.c:632:16: [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). nextchar += strlen (nextchar); data/qiv-2.3.2/lib/getopt.c:662:17: [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). nextchar += strlen (nextchar); data/qiv-2.3.2/lib/getopt.c:678:17: [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). nextchar += strlen (nextchar); data/qiv-2.3.2/lib/getopt.c:683:16: [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). nextchar += strlen (nextchar); data/qiv-2.3.2/lib/getopt.c:794:51: [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 ((unsigned int) (nameend - nextchar) == strlen (p->name)) data/qiv-2.3.2/lib/getopt.c:817:18: [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). nextchar += strlen (nextchar); data/qiv-2.3.2/lib/getopt.c:837: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). nextchar += strlen (nextchar); data/qiv-2.3.2/lib/getopt.c:851: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). nextchar += strlen (nextchar); data/qiv-2.3.2/lib/getopt.c:855:18: [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). nextchar += strlen (nextchar); data/qiv-2.3.2/main.c:67:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(select_dir, SELECT_DIR, sizeof select_dir); data/qiv-2.3.2/main.c:341:52: [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 (strncasecmp(description, image_magic[i], strlen(image_magic[i])) == 0) data/qiv-2.3.2/options.c:143:21: [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). sufptr1 = cp1 + strlen((char *)cp1); data/qiv-2.3.2/options.c:145:21: [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). sufptr2 = cp2 + strlen((char *)cp2); data/qiv-2.3.2/options.c:407:37: [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 *tmp = (char *)xmalloc(strlen(image_names[0])+3); data/qiv-2.3.2/utils.c:48:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(path_result, filename, PATH_MAX); data/qiv-2.3.2/utils.c:62:5: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant character. strncat(path_result, "/", PATH_MAX - strlen(path_result) ); data/qiv-2.3.2/utils.c:62:42: [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). strncat(path_result, "/", PATH_MAX - strlen(path_result) ); data/qiv-2.3.2/utils.c:63:5: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(path_result, ptr + 1, PATH_MAX - strlen(path_result) ); data/qiv-2.3.2/utils.c:63: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). strncat(path_result, ptr + 1, PATH_MAX - strlen(path_result) ); data/qiv-2.3.2/utils.c:204:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(dstfilebak, tmp, sizeof dstfilebak); data/qiv-2.3.2/utils.c:218:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while((n = read(fdi, buf, BUFSIZ)) > 0) write(fdo, buf, n); data/qiv-2.3.2/utils.c:334:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(pipe_stdout[0], s, MAXOUTPUTBUFFER - (s - buffer)); data/qiv-2.3.2/utils.c:631:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(cdirname, dirname, sizeof cdirname); data/qiv-2.3.2/utils.c:692: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). linelen = strlen(line) -1; data/qiv-2.3.2/utils.c:874:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(comment, (char *) marker->data, marker->data_length); data/qiv-2.3.2/utils.c:877: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). int len = strlen(comment); data/qiv-2.3.2/utils.c:1020: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). int len=strlen(buffer); ANALYSIS SUMMARY: Hits = 89 Lines analyzed = 6091 in approximately 0.18 seconds (33687 lines/second) Physical Source Lines of Code (SLOC) = 4554 Hits@level = [0] 113 [1] 31 [2] 29 [3] 15 [4] 14 [5] 0 Hits@level+ = [0+] 202 [1+] 89 [2+] 58 [3+] 29 [4+] 14 [5+] 0 Hits/KSLOC@level+ = [0+] 44.3566 [1+] 19.5433 [2+] 12.7361 [3+] 6.36803 [4+] 3.07422 [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.