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/netrik-1.16.1/cfg.h Examining data/netrik-1.16.1/cmdline.c Examining data/netrik-1.16.1/cmdline.h Examining data/netrik-1.16.1/debug.c Examining data/netrik-1.16.1/debug.h Examining data/netrik-1.16.1/dump-tree.c Examining data/netrik-1.16.1/facilities.c Examining data/netrik-1.16.1/http-parse-header.c Examining data/netrik-1.16.1/http-parse-header.h Examining data/netrik-1.16.1/http.c Examining data/netrik-1.16.1/http.h Examining data/netrik-1.16.1/items.c Examining data/netrik-1.16.1/items.h Examining data/netrik-1.16.1/layout.c Examining data/netrik-1.16.1/layout.h Examining data/netrik-1.16.1/links.c Examining data/netrik-1.16.1/links.h Examining data/netrik-1.16.1/load.c Examining data/netrik-1.16.1/load.h Examining data/netrik-1.16.1/pager.c Examining data/netrik-1.16.1/pager.h Examining data/netrik-1.16.1/parse-elements.c Examining data/netrik-1.16.1/parse-syntax.c Examining data/netrik-1.16.1/pre-render.c Examining data/netrik-1.16.1/render.c Examining data/netrik-1.16.1/render.h Examining data/netrik-1.16.1/screen.c Examining data/netrik-1.16.1/screen.h Examining data/netrik-1.16.1/syntax.h Examining data/netrik-1.16.1/page.c Examining data/netrik-1.16.1/page.h Examining data/netrik-1.16.1/url.c Examining data/netrik-1.16.1/url.h Examining data/netrik-1.16.1/forms.c Examining data/netrik-1.16.1/forms.h Examining data/netrik-1.16.1/sgml.c Examining data/netrik-1.16.1/readline.c Examining data/netrik-1.16.1/readline.h Examining data/netrik-1.16.1/search.c Examining data/netrik-1.16.1/search.h Examining data/netrik-1.16.1/form-file.c Examining data/netrik-1.16.1/form-file.h Examining data/netrik-1.16.1/colors.h Examining data/netrik-1.16.1/colors.c Examining data/netrik-1.16.1/colors-dark.c Examining data/netrik-1.16.1/colors-bright.c Examining data/netrik-1.16.1/interrupt.c Examining data/netrik-1.16.1/interrupt.h Examining data/netrik-1.16.1/winch.c Examining data/netrik-1.16.1/winch.h Examining data/netrik-1.16.1/cfg.c Examining data/netrik-1.16.1/main.c Examining data/netrik-1.16.1/parse-struct.c FINAL RESULTS: data/netrik-1.16.1/debug.c:31:4: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, arg_ptr); data/netrik-1.16.1/form-file.c:112:7: [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(temp_name, size, format, name); data/netrik-1.16.1/form-file.c:149:3: [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(edit_cmd, size, format, editor, temp_name); data/netrik-1.16.1/form-file.c:152:6: [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. if(system(edit_cmd)!=0) { data/netrik-1.16.1/forms.c:290:20: [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. result.size+=snprintf(&result.data[result.size], part_len, format, link->name, file_name); /* store header */ data/netrik-1.16.1/http-parse-header.c:132:5: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, parse_mode==PM_START ? "\nNo HTTP response.\n" : "\nUnexpected end of file while parsing HTTP header.\n"); data/netrik-1.16.1/http.c:80:7: [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(cmd.data, url->path); data/netrik-1.16.1/http.c:82:7: [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(cmd.data, url->full_url); data/netrik-1.16.1/http.c:84:4: [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(cmd.data, url->host); data/netrik-1.16.1/http.c:92:7: [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(cmd.data, content_len); data/netrik-1.16.1/load.c:47:4: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(cmd, WGET_CMD, res->url->full_url); /* create command line for wget */ data/netrik-1.16.1/load.c:48:23: [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. res->handle.stream=popen(cmd, "r"); /* call in background, get output as pipe */ data/netrik-1.16.1/load.c:189: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(real_path, F_OK)==0) { /* file exists -> keep this one */ data/netrik-1.16.1/load.c:205:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(x_url, "http://%s", main_url); data/netrik-1.16.1/load.c:249:7: [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(cmd, sizeof(cmd), compress[try].cmd, real_path); data/netrik-1.16.1/load.c:252:28: [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. res->handle.stream = popen(cmd, "r"); data/netrik-1.16.1/main.c:430:8: [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(url, link->value.data); /* save link URL before killing old page */ data/netrik-1.16.1/main.c:458:7: [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(new_value, R_OK)==-1) { data/netrik-1.16.1/parse-struct.c:277:4: [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(&string->text[old_len], text); /* concatenate new text */ data/netrik-1.16.1/parse-struct.c:625:8: [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(&value[value_len], sub_el->content); data/netrik-1.16.1/parse-syntax.c:163:4: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(err_msg, arg_ptr); data/netrik-1.16.1/parse-syntax.c:180:4: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(handling_msg, arg_ptr); data/netrik-1.16.1/url.c:377:4: [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(*str, append); data/netrik-1.16.1/url.c:470:3: [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(merged_dir, base_url->dir); data/netrik-1.16.1/url.c:484:3: [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(merged_dir, merge_part); /* concatenate the part of the relative path remaining after skipping all the "./" and "../" */ data/netrik-1.16.1/cmdline.c:63:9: [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, "", longopts, &option_index); data/netrik-1.16.1/form-file.c:99:11: [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. editor=getenv("EDITOR"); data/netrik-1.16.1/http.c:168:13: [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. proxy=getenv("http_proxy"); data/netrik-1.16.1/http.c:170:9: [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. proxy=getenv("HTTP_PROXY"); data/netrik-1.16.1/main.c:65:12: [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. home=getenv("HOME"); data/netrik-1.16.1/readline.c:32:24: [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 int use_cols=(getenv("COLUMNS")!=NULL); data/netrik-1.16.1/readline.c:33: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. const int use_lines=(getenv("LINES")!=NULL); data/netrik-1.16.1/screen.c:149:8: [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. term=getenv("TERM"); data/netrik-1.16.1/form-file.c:52: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). fildes=open(file_name, O_RDONLY); data/netrik-1.16.1/form-file.c:111: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 temp_name[size]; data/netrik-1.16.1/form-file.c:126:10: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). fildes=mkstemp(temp_name); data/netrik-1.16.1/form-file.c:148: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 edit_cmd[size]; data/netrik-1.16.1/forms.c:292: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(&result.data[result.size], value.data, value.size); /* store data */ data/netrik-1.16.1/forms.c:298: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(&result.data[result.size], line_feed, sizeof(line_feed)); /* store linefeed */ data/netrik-1.16.1/forms.c:311: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(&result.data[result.size], footer, sizeof(footer)); data/netrik-1.16.1/http-parse-header.c:74:4: [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(strchr(*str, '\0'), "%c", chr); data/netrik-1.16.1/http.c:47:4: [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 content_len[15]; data/netrik-1.16.1/http.c:76:7: [2] (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). Risk is low because the source is a constant string. strcpy(cmd.data, "GET "); data/netrik-1.16.1/http.c:78:7: [2] (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). Risk is low because the source is a constant string. strcpy(cmd.data, "POST "); data/netrik-1.16.1/http.c:83:4: [2] (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). Risk is low because the source is a constant string. strcat(cmd.data, " HTTP/1.0\r\nHost: "); data/netrik-1.16.1/http.c:85:4: [2] (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). Risk is low because the source is a constant string. strcat(cmd.data, "\r\nUser-Agent: Not mandatory, so FUCK YOU"); /* some morons insist on this header, so give it to them... */ data/netrik-1.16.1/http.c:86:4: [2] (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). Risk is low because the source is a constant string. strcat(cmd.data, "\r\nConnection: Close"); data/netrik-1.16.1/http.c:89:3: [2] (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). Risk is low because the source is a constant string. strcat(cmd.data, "\r\nContent-Type: multipart/form-data; boundary="MIME_BOUNDRY"\r\nContent-length: "); data/netrik-1.16.1/http.c:91:3: [2] (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). Risk is low because the source is a constant string. strcat(cmd.data, "\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-length: "); data/netrik-1.16.1/http.c:94:4: [2] (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). Risk is low because the source is a constant string. strcat(cmd.data, "\r\n\r\n"); data/netrik-1.16.1/http.c:98: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(&cmd.data[cmd.size], form_data.data, form_data.size); data/netrik-1.16.1/load.c:43:4: [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 cmd[strlen(res->url->full_url)+sizeof(WGET_CMD)]; data/netrik-1.16.1/load.c:170:6: [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 real_path[strlen(path)+sizeof(".bz2")]; /* real file name of (possibly compressed) local file */ data/netrik-1.16.1/load.c:202: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. char x_url[sizeof("http://")+strlen(main_url)]; /* URL string with prepended protocol specification */ data/netrik-1.16.1/load.c:239: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 cmd[strlen(compress[try].cmd)+strlen(real_path)]; data/netrik-1.16.1/load.c:262:27: [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). res->handle.stream=fopen(real_path, "r"); data/netrik-1.16.1/main.c:68: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 cfg_name[strlen(home)+sizeof("/.netrikrc")]; data/netrik-1.16.1/main.c:88: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). cfg_file=fopen(cfg_name, "r"); data/netrik-1.16.1/main.c:116:39: [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. argv_all=realloc(argv_all, sizeof(char *[++argc_all+argc])); /* also reserve the space for the command line arguments already */ data/netrik-1.16.1/main.c:128:6: [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(&argv_all[argc_all+1], argv+1, sizeof(char *[argc-1])); data/netrik-1.16.1/main.c:128:51: [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. memcpy(&argv_all[argc_all+1], argv+1, sizeof(char *[argc-1])); data/netrik-1.16.1/main.c:429: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. char url[strlen(link->value.data)+1]; data/netrik-1.16.1/pager.c:239: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 tag[taglen+1]; /* 0-terminated */ data/netrik-1.16.1/parse-elements.c:86:49: [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). cur_el->attr[cur_attr].value.num=atoi(tmpval); data/netrik-1.16.1/parse-elements.c:105:49: [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). cur_el->attr[cur_el->attr_count-1].value.num=atoi(attr_table[i].def_val); data/netrik-1.16.1/parse-struct.c:536: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 line_buf[size+1]; data/netrik-1.16.1/parse-struct.c:638: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. char line_buf[size+1]; data/netrik-1.16.1/parse-struct.c:680:16: [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). for(i=1; i<atoi(new_el->attr[span_attr].value.str); ++i) /* all but first spanned cell */ data/netrik-1.16.1/parse-syntax.c:139:36: [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. ignore=realloc(ignore, sizeof(char *[msg+2])); data/netrik-1.16.1/readline.c:42:4: [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[1024]; /* user input */ data/netrik-1.16.1/render.c:172: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. char output_string[div_end-div_start+1]; data/netrik-1.16.1/render.c:232: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 clr_string[width+1]; data/netrik-1.16.1/render.c:294: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 output_string[div_end-div_start+1]; data/netrik-1.16.1/syntax.h:64:4: [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 name[8]; /* textual element name */ data/netrik-1.16.1/syntax.h:98:4: [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 name[8]; /* attribute name */ data/netrik-1.16.1/syntax.h:101:4: [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 def_val[5]; /* the default value. if this is set to a nonzero value it also means that the attribute is obligatory for this element */ data/netrik-1.16.1/syntax.h:135:4: [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 str[7]; /* reference name */ data/netrik-1.16.1/url.c:87:4: [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 escaped_url[3*strlen(url)+1]; /* enough for worst case of all characters needing escaping */ data/netrik-1.16.1/url.c:101: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(components, &def, sizeof(def)); data/netrik-1.16.1/url.c:247:26: [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). components->port=atoi(word_start); data/netrik-1.16.1/url.c:467: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 merged_dir[strlen(base_url->dir)+strlen(main_url->dir)+1]; data/netrik-1.16.1/url.c:562: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 port_str[7]; data/netrik-1.16.1/form-file.c:66:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(fildes, data, size)!=size) { data/netrik-1.16.1/form-file.c:110:38: [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). const int size=sizeof(format)+strlen(name); data/netrik-1.16.1/form-file.c:147:34: [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). const int size=sizeof(format)+strlen(temp_name)+strlen(editor); data/netrik-1.16.1/form-file.c:147: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). const int size=sizeof(format)+strlen(temp_name)+strlen(editor); data/netrik-1.16.1/forms.c:216:44: [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). struct Data_string name={link->name, strlen(link->name)}; /* form elment's name as Data_string */ data/netrik-1.16.1/forms.c:282: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). part_len= strlen(format) + strlen(link->name) + strlen(file_name) + value.size + sizeof(line_feed); /* a few bytes too much, but who cares... */ data/netrik-1.16.1/forms.c:282:34: [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). part_len= strlen(format) + strlen(link->name) + strlen(file_name) + value.size + sizeof(line_feed); /* a few bytes too much, but who cares... */ data/netrik-1.16.1/forms.c:282:55: [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). part_len= strlen(format) + strlen(link->name) + strlen(file_name) + value.size + sizeof(line_feed); /* a few bytes too much, but who cares... */ data/netrik-1.16.1/forms.c:299:20: [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). result.size+=strlen(line_feed); data/netrik-1.16.1/forms.c:312:20: [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). result.size+=strlen(footer); data/netrik-1.16.1/http-parse-header.c:73: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). *str=realloc(*str, sizeof(char[strlen(*str)+2])); data/netrik-1.16.1/http.c:59:8: [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). len=strlen(form==NULL?"GET ":"POST "); data/netrik-1.16.1/http.c:60: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). len+= proxy!=NULL ? strlen(url->full_url) : strlen(url->path); data/netrik-1.16.1/http.c:60:48: [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). len+= proxy!=NULL ? strlen(url->full_url) : strlen(url->path); data/netrik-1.16.1/http.c:61: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). len+=strlen(" HTTP/1.0\r\nHost: "); data/netrik-1.16.1/http.c:62: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). len+=strlen(url->host); data/netrik-1.16.1/http.c:63: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). len+=strlen("\r\nUser-Agent: Not mandatory, so FUCK YOU"); data/netrik-1.16.1/http.c:64: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). len+=strlen("\r\nConnection: Close"); data/netrik-1.16.1/http.c:66:60: [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). len+= form->data.form->method==METHOD_POST_MIMEENC ? strlen("\r\nContent-Type: multipart/form-data; boundary="MIME_BOUNDRY"\r\nContent-length: ") : strlen("\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-length: "); data/netrik-1.16.1/http.c:66:155: [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). len+= form->data.form->method==METHOD_POST_MIMEENC ? strlen("\r\nContent-Type: multipart/form-data; boundary="MIME_BOUNDRY"\r\nContent-length: ") : strlen("\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-length: "); data/netrik-1.16.1/http.c:67: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). len+=strlen(content_len); data/netrik-1.16.1/http.c:69: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). len+=strlen("\r\n\r\n"); data/netrik-1.16.1/http.c:96: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). cmd.size=strlen(cmd.data); data/netrik-1.16.1/load.c:43: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). char cmd[strlen(res->url->full_url)+sizeof(WGET_CMD)]; data/netrik-1.16.1/load.c:170: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). char real_path[strlen(path)+sizeof(".bz2")]; /* real file name of (possibly compressed) local file */ data/netrik-1.16.1/load.c:202:38: [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 x_url[sizeof("http://")+strlen(main_url)]; /* URL string with prepended protocol specification */ data/netrik-1.16.1/load.c:239: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). char cmd[strlen(compress[try].cmd)+strlen(real_path)]; data/netrik-1.16.1/load.c:239: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). char cmd[strlen(compress[try].cmd)+strlen(real_path)]; data/netrik-1.16.1/load.c:336:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). chars_read=read(res->handle.http->socket, res->buf, BUF_SIZE); data/netrik-1.16.1/main.c:68: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). char cfg_name[strlen(home)+sizeof("/.netrikrc")]; data/netrik-1.16.1/main.c:195:13: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). cbreak(); getchar(); endwin(); /* wait for *single* keypress (endwin() resets normal scroll mode terminal settings) */ data/netrik-1.16.1/main.c:429: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). char url[strlen(link->value.data)+1]; data/netrik-1.16.1/main.c:453:49: [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). link->value.data=new_value; link->value.size=strlen(new_value); data/netrik-1.16.1/main.c:679:16: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). cbreak(); getchar(); endwin(); /* wait for *single* keypress (endwin() resets normal scroll mode terminal settings) */ data/netrik-1.16.1/pager.c:467: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). const int size=strlen(cfg.anchor_mark); data/netrik-1.16.1/parse-struct.c:267:20: [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). new_len=old_len+strlen(text); /* add len of new text */ data/netrik-1.16.1/parse-struct.c:618: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). const int new_len=value_len+strlen(sub_el->content); data/netrik-1.16.1/parse-struct.c:785:43: [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). string->link[new_link].value.size=strlen(cur_state->link_value); data/netrik-1.16.1/parse-syntax.c:541: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). int len=strlen(ref_table[i].str); data/netrik-1.16.1/readline.c:47:8: [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). buf[strlen(buf)-1]=0; /* discard trailing newline returned by fgets() */ data/netrik-1.16.1/screen.c:142:3: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). getchar(); data/netrik-1.16.1/url.c:55:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(*component, start, len); data/netrik-1.16.1/url.c:87: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). char escaped_url[3*strlen(url)+1]; /* enough for worst case of all characters needing escaping */ data/netrik-1.16.1/url.c:371: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). *str=realloc(*str, sizeof(char[strlen(*str)+strlen(append)+1])); data/netrik-1.16.1/url.c:371:48: [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). *str=realloc(*str, sizeof(char[strlen(*str)+strlen(append)+1])); data/netrik-1.16.1/url.c:467: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). char merged_dir[strlen(base_url->dir)+strlen(main_url->dir)+1]; data/netrik-1.16.1/url.c:467:41: [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 merged_dir[strlen(base_url->dir)+strlen(main_url->dir)+1]; data/netrik-1.16.1/url.c:567: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). path_pos=strlen(url->full_url); /* path starts where "dir" and following components will be appended (present string end) */ data/netrik-1.16.1/url.c:598: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). result=malloc(strlen(escaped)+1); ANALYSIS SUMMARY: Hits = 131 Lines analyzed = 9799 in approximately 0.34 seconds (28672 lines/second) Physical Source Lines of Code (SLOC) = 6703 Hits@level = [0] 213 [1] 49 [2] 49 [3] 8 [4] 25 [5] 0 Hits@level+ = [0+] 344 [1+] 131 [2+] 82 [3+] 33 [4+] 25 [5+] 0 Hits/KSLOC@level+ = [0+] 51.3203 [1+] 19.5435 [2+] 12.2333 [3+] 4.92317 [4+] 3.72967 [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.