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/wput-0.6.2+git20130413/src/socketlib.h Examining data/wput-0.6.2+git20130413/src/memdbg.c Examining data/wput-0.6.2+git20130413/src/_queue.h Examining data/wput-0.6.2+git20130413/src/netrc.h Examining data/wput-0.6.2+git20130413/src/queue.c Examining data/wput-0.6.2+git20130413/src/config.h Examining data/wput-0.6.2+git20130413/src/getopt/getopt.h Examining data/wput-0.6.2+git20130413/src/getopt/getopt1.c Examining data/wput-0.6.2+git20130413/src/getopt/getopt.c Examining data/wput-0.6.2+git20130413/src/wget.h Examining data/wput-0.6.2+git20130413/src/utils.c Examining data/wput-0.6.2+git20130413/src/msvcpp/strptime.c Examining data/wput-0.6.2+git20130413/src/url.h Examining data/wput-0.6.2+git20130413/src/socketlib.c Examining data/wput-0.6.2+git20130413/src/constants.h Examining data/wput-0.6.2+git20130413/src/progress.h Examining data/wput-0.6.2+git20130413/src/netrc.c Examining data/wput-0.6.2+git20130413/src/ftp.h Examining data/wput-0.6.2+git20130413/src/ftplib.h Examining data/wput-0.6.2+git20130413/src/windows.h Examining data/wput-0.6.2+git20130413/src/utils.h Examining data/wput-0.6.2+git20130413/src/ftplib.c Examining data/wput-0.6.2+git20130413/src/ftp-ls.c Examining data/wput-0.6.2+git20130413/src/ftp.c Examining data/wput-0.6.2+git20130413/src/progress.c Examining data/wput-0.6.2+git20130413/src/wput.h Examining data/wput-0.6.2+git20130413/src/wput.c FINAL RESULTS: data/wput-0.6.2+git20130413/src/ftp.c:811:26: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. if(res == ERR_OK && opt.chmod) { data/wput-0.6.2+git20130413/src/ftplib.c:625:48: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. snprintf(mode, 7, "%lo", (unsigned long) opt.chmod); data/wput-0.6.2+git20130413/src/wput.h:128:10: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. mode_t chmod; data/wput-0.6.2+git20130413/src/constants.h:64:9: [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). #define strcat(x,y) dbg_strcat(x,y, __FILE__, __LINE__) data/wput-0.6.2+git20130413/src/ftp-ls.c:778: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( date_str, tok); data/wput-0.6.2+git20130413/src/ftp-ls.c:1001:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (upwd, "%s%s%s@", tmpu, tmpp ? ":" : "", tmpp ? tmpp : ""); data/wput-0.6.2+git20130413/src/ftp.c:232:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cmd, "%s ftp \"%s\" \"%s\" %d \"%s\" \"%s\"", data/wput-0.6.2+git20130413/src/ftp.c:237:10: [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. pipe = popen(cmd, "r"); data/wput-0.6.2+git20130413/src/ftp.c:502: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(newpath, fsession->ftp->current_directory); data/wput-0.6.2+git20130413/src/ftp.c:504: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(newpath, filename); data/wput-0.6.2+git20130413/src/ftplib.c:170: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(self->sbuf, cmd); data/wput-0.6.2+git20130413/src/ftplib.c:174: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(self->sbuf+pos+1, value); data/wput-0.6.2+git20130413/src/ftplib.c:633: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(value, mode); data/wput-0.6.2+git20130413/src/ftplib.c:635:2: [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(value, rfile); data/wput-0.6.2+git20130413/src/ftplib.c:688: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(list, rbuf); data/wput-0.6.2+git20130413/src/memdbg.c:107: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(t, s); data/wput-0.6.2+git20130413/src/memdbg.c:114:12: [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). return strcat(s,p); data/wput-0.6.2+git20130413/src/queue.c:262: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(tmpbuf, dname); data/wput-0.6.2+git20130413/src/queue.c:305: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(fname, tmpbuf); data/wput-0.6.2+git20130413/src/queue.c:306: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(fname + pathlen-2, cFileName); data/wput-0.6.2+git20130413/src/queue.c:309: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(fname, tmpbuf); data/wput-0.6.2+git20130413/src/queue.c:310: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(fname + strlen(tmpbuf), cFileName); data/wput-0.6.2+git20130413/src/queue.c:475: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(file, fsession->target_dname); data/wput-0.6.2+git20130413/src/queue.c:478:31: [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(fsession->target_fname) strcat(file, fsession->target_fname); data/wput-0.6.2+git20130413/src/socketlib.c:324: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(ifr.ifr_name,ifname); data/wput-0.6.2+git20130413/src/socketlib.c:456:9: [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(p+2, ps->user); data/wput-0.6.2+git20130413/src/socketlib.c:539: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(t+5, hostname); data/wput-0.6.2+git20130413/src/socketlib.c:582: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(userunencoded, ps->user); data/wput-0.6.2+git20130413/src/socketlib.c:583: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(userunencoded+strlen(ps->user)+1, ps->pass); data/wput-0.6.2+git20130413/src/socketlib.c:594:13: [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(request, hostname); data/wput-0.6.2+git20130413/src/socketlib.c:596:13: [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(request, printip((unsigned char *) &ip)); data/wput-0.6.2+git20130413/src/socketlib.c:601:13: [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(request, str_port); data/wput-0.6.2+git20130413/src/socketlib.c:606:13: [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(request, userencoded); data/wput-0.6.2+git20130413/src/utils.c:158:10: [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. return access (filename, F_OK) >= 0; data/wput-0.6.2+git20130413/src/utils.c:390: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(t, s); data/wput-0.6.2+git20130413/src/utils.c:470:2: [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(tmp, mark_dst); data/wput-0.6.2+git20130413/src/utils.c:502:15: [4] (shell) execv: 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 = execv(opt.scriptfile, argv); data/wput-0.6.2+git20130413/src/windows.h:53:9: [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. #define popen _popen data/wput-0.6.2+git20130413/src/wput.c:467:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (path, "%s/%s", home, NETRC_FILE_NAME); data/wput-0.6.2+git20130413/src/wput.c:534:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(file, "%s/%s", home, WPUTRC_FILENAME); data/wput-0.6.2+git20130413/src/ftp-ls.c:861:18: [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. if ((tok = getenv( "WGET_TIMEZONE_DIFFERENTIAL")) != NULL) data/wput-0.6.2+git20130413/src/getopt/getopt.c:222: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. #ifndef getenv data/wput-0.6.2+git20130413/src/getopt/getopt.c:223:14: [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. extern char *getenv (); data/wput-0.6.2+git20130413/src/getopt/getopt.c:408: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/wput-0.6.2+git20130413/src/getopt/getopt.c:1198: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/wput-0.6.2+git20130413/src/getopt/getopt.c:1228: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/wput-0.6.2+git20130413/src/getopt/getopt.h:145: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/wput-0.6.2+git20130413/src/getopt/getopt.h:147: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/wput-0.6.2+git20130413/src/getopt/getopt.h:151: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, data/wput-0.6.2+git20130413/src/getopt/getopt.h:165: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/wput-0.6.2+git20130413/src/getopt/getopt.h:167: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/wput-0.6.2+git20130413/src/getopt/getopt1.c:71: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/wput-0.6.2+git20130413/src/getopt/getopt1.c:98:18: [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. libc_hidden_def (getopt_long) data/wput-0.6.2+git20130413/src/getopt/getopt1.c:131: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/wput-0.6.2+git20130413/src/progress.c:227:19: [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. if ((p = getenv("COLUMNS")) != NULL) data/wput-0.6.2+git20130413/src/socketlib.c:662:19: [3] (misc) LoadLibrary: Ensure that the full path to the library is specified, or current directory may be used (CWE-829, CWE-20). Use registry entry or GetWindowsDirectory to find library path, if you aren't already. void * hLibSSL = LoadLibrary("SSLEAY32.DLL"); data/wput-0.6.2+git20130413/src/socketlib.c:665:13: [3] (misc) LoadLibrary: Ensure that the full path to the library is specified, or current directory may be used (CWE-829, CWE-20). Use registry entry or GetWindowsDirectory to find library path, if you aren't already. hLibSSL = LoadLibrary("LIBSSL32.DLL"); data/wput-0.6.2+git20130413/src/utils.c:169:16: [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 *home = getenv ("HOME"); data/wput-0.6.2+git20130413/src/wput.c:142: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. readwputrc(getenv("WPUTRC")); data/wput-0.6.2+git20130413/src/wput.c:144:14: [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. parse_proxy(getenv("ftp_proxy")); data/wput-0.6.2+git20130413/src/wput.c:147: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. read_password_file(getenv("PASSWORDFILE")); data/wput-0.6.2+git20130413/src/wput.c:643:13: [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, "Y:Vhbo:a:dqvn:i:I:t:NT:w:Rl:pABsS:um::", data/wput-0.6.2+git20130413/src/constants.h:60: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). #define open(x,y) dbg_open(x,y, __FILE__, __LINE__) data/wput-0.6.2+git20130413/src/ftp-ls.c:127:8: [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 (file, "r"); data/wput-0.6.2+git20130413/src/ftp-ls.c:344:8: [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 (cur.name, tok, fnlen + 1); data/wput-0.6.2+git20130413/src/ftp-ls.c:390:4: [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 (l, &cur, sizeof (cur)); data/wput-0.6.2+git20130413/src/ftp-ls.c:398:4: [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 (l, &cur, sizeof (cur)); data/wput-0.6.2+git20130413/src/ftp-ls.c:450:8: [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 (file, "r"); data/wput-0.6.2+git20130413/src/ftp-ls.c:477:15: [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). month = atoi(tok) - 1; data/wput-0.6.2+git20130413/src/ftp-ls.c:480: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). day = atoi(tok); data/wput-0.6.2+git20130413/src/ftp-ls.c:482:14: [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). year = atoi(tok); data/wput-0.6.2+git20130413/src/ftp-ls.c:489:14: [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). hour = atoi(tok); data/wput-0.6.2+git20130413/src/ftp-ls.c:491: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). min = atoi(tok); data/wput-0.6.2+git20130413/src/ftp-ls.c:531: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). cur.size = atoi(tok); data/wput-0.6.2+git20130413/src/ftp-ls.c:542:4: [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 (l, &cur, sizeof (cur)); data/wput-0.6.2+git20130413/src/ftp-ls.c:550:4: [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 (l, &cur, sizeof (cur)); data/wput-0.6.2+git20130413/src/ftp-ls.c:585: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 date_str[ 32]; data/wput-0.6.2+git20130413/src/ftp-ls.c:590:8: [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 (file, "r"); data/wput-0.6.2+git20130413/src/ftp-ls.c:863: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). dt = atoi( tok); data/wput-0.6.2+git20130413/src/ftp-ls.c:886:11: [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 (l, &cur, sizeof (cur)); data/wput-0.6.2+git20130413/src/ftp-ls.c:894:11: [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 (l, &cur, sizeof (cur)); data/wput-0.6.2+git20130413/src/ftp-ls.c:943:7: [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 (file, "r"); data/wput-0.6.2+git20130413/src/ftp-ls.c:984:12: [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 (file, "w"); data/wput-0.6.2+git20130413/src/ftp.c:218:10: [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((fd=open(fsession->local_fname, oflags)) == -1) { data/wput-0.6.2+git20130413/src/ftp.c:264:2: [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 databuf[DBUFSIZE]; data/wput-0.6.2+git20130413/src/ftp.c:277:2: [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 convertbuf[DBUFSIZE]; data/wput-0.6.2+git20130413/src/ftp.c:875: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). fsession->host->port = atoi(d + 1); data/wput-0.6.2+git20130413/src/ftplib.c:120:20: [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). self->r.code = atoi(msg); data/wput-0.6.2+git20130413/src/ftplib.c:435:20: [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). #define MDTM_AT(x) atoi(self->r.message+x); self->r.message[x] = 0 data/wput-0.6.2+git20130413/src/ftplib.c:441:18: [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). ts.tm_year = atoi(self->r.message) - 1900; data/wput-0.6.2+git20130413/src/ftplib.c:660:2: [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 rbuf[1024]; data/wput-0.6.2+git20130413/src/ftplib.c:734:2: [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 tmpbuf[21]; data/wput-0.6.2+git20130413/src/ftplib.c:1054:2: [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(res, src, sizeof(struct tm)); data/wput-0.6.2+git20130413/src/ftplib.c:1115:2: [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[6]; data/wput-0.6.2+git20130413/src/ftplib.c:1119:15: [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). temp[i++] = atoi(curtok); data/wput-0.6.2+git20130413/src/memdbg.c:99:12: [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). return open(path, flags); data/wput-0.6.2+git20130413/src/msvcpp/strptime.c:48:2: [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 *abbrev_month_names[12]; data/wput-0.6.2+git20130413/src/msvcpp/strptime.c:49:2: [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 *month_names[12]; data/wput-0.6.2+git20130413/src/msvcpp/strptime.c:50:2: [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 *abbrev_weekday_names[7]; data/wput-0.6.2+git20130413/src/msvcpp/strptime.c:51:2: [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 *weekday_names[7]; data/wput-0.6.2+git20130413/src/netrc.c:118:8: [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 (path, "r"); data/wput-0.6.2+git20130413/src/progress.c:181: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 output[15]; data/wput-0.6.2+git20130413/src/progress.c:228: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). termwidth = atoi(p); data/wput-0.6.2+git20130413/src/progress.c:243:2: [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 * units[2][4] = { data/wput-0.6.2+git20130413/src/progress.c:248: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. static char buf[12] = " --.--"; data/wput-0.6.2+git20130413/src/progress.c:287: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. static char buf[11] = {0}; data/wput-0.6.2+git20130413/src/progress.c:387:4: [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(bar.last_transfered, bar.last_transfered+1, sizeof(int)*(SPEED_BACKTRACE-1)); data/wput-0.6.2+git20130413/src/queue.c:246:2: [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 tmpbuf[MAX_PATH]; data/wput-0.6.2+git20130413/src/socketlib.c:39:36: [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. # define int64toa(num, buf, base) sprintf(buf, "%d", num) data/wput-0.6.2+git20130413/src/socketlib.c:310:3: [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(ip, ht->h_addr_list[0], 4); data/wput-0.6.2+git20130413/src/socketlib.c:332:3: [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(&sa,&ifr.ifr_addr,16); data/wput-0.6.2+git20130413/src/socketlib.c:345:3: [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 (local_ip, &mysrv.sin_addr, 4); data/wput-0.6.2+git20130413/src/socketlib.c:421:2: [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 t[4] = {5, 1, 0}; data/wput-0.6.2+git20130413/src/socketlib.c:482:2: [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 t[10] = {5, 2, 0, 1, 0, 0, 0, 0, 0, 0}; data/wput-0.6.2+git20130413/src/socketlib.c:508:2: [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 t[10]; data/wput-0.6.2+git20130413/src/socketlib.c:537:4: [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(t, "\5\1\0\3", 4); data/wput-0.6.2+git20130413/src/socketlib.c:541:4: [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(t+strlen(hostname)+5, (char *) &res, 2); data/wput-0.6.2+git20130413/src/socketlib.c:548:4: [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(t, "\5\1\0\1", 4); data/wput-0.6.2+git20130413/src/socketlib.c:550:4: [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(t+4, &ip, 4); data/wput-0.6.2+git20130413/src/socketlib.c:552:4: [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(t+8, &res, 2); data/wput-0.6.2+git20130413/src/socketlib.c:592:9: [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(request, "CONNECT "); data/wput-0.6.2+git20130413/src/socketlib.c:599:13: [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_port[6]; data/wput-0.6.2+git20130413/src/socketlib.c:603:9: [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(request, " HTTP/1.0"); data/wput-0.6.2+git20130413/src/socketlib.c:605:13: [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(request, "\r\nProxy-Authorization: Basic "); data/wput-0.6.2+git20130413/src/socketlib.c:609:9: [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(request, "\r\n\r\n"); data/wput-0.6.2+git20130413/src/utils.c:76: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. unsigned char b[6]; data/wput-0.6.2+git20130413/src/utils.c:77: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. static char buf[6 * 4]; data/wput-0.6.2+git20130413/src/utils.c:81: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,%d,%d,%d,%d,%d", b[0], b[1], b[2], b[3], b[4], b[5]); data/wput-0.6.2+git20130413/src/utils.c:92: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 fmtbuf[256]; data/wput-0.6.2+git20130413/src/utils.c:132:11: [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(fmtbuf, "%x", (int) i); data/wput-0.6.2+git20130413/src/utils.c:236: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. static char rv[16]; data/wput-0.6.2+git20130413/src/utils.c:237: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(rv, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]); data/wput-0.6.2+git20130413/src/utils.c:328: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 outbuf[48]; /* TODO NRV adjust this value to a serious one. who cares? */ data/wput-0.6.2+git20130413/src/utils.c:366: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 inbuf[24]; data/wput-0.6.2+git20130413/src/utils.c:469: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(tmp, "../"); data/wput-0.6.2+git20130413/src/utils.c:489: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 argv[3] = { event, url, file }; data/wput-0.6.2+git20130413/src/wget.h:8:9: [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). #define fopen( x, y) stdin data/wput-0.6.2+git20130413/src/wput.c:158:20: [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). opt.output = fopen("wput-log", "a"); data/wput-0.6.2+git20130413/src/wput.c:379:25: [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). opt.ps.port = atoi(val); data/wput-0.6.2+git20130413/src/wput.c:393:29: [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). opt.speed_limit = atoi(val); data/wput-0.6.2+git20130413/src/wput.c:401:25: [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). opt.retry = atoi(val); data/wput-0.6.2+git20130413/src/wput.c:414:36: [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). socket_set_default_timeout(atoi(val)); data/wput-0.6.2+git20130413/src/wput.c:419:31: [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). opt.time_offset = atoi(val); data/wput-0.6.2+git20130413/src/wput.c:421:31: [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). opt.time_deviation = atoi(val); data/wput-0.6.2+git20130413/src/wput.c:443:30: [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). opt.retry_interval = atoi(val); data/wput-0.6.2+git20130413/src/wput.c:507:7: [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(f, "r"); data/wput-0.6.2+git20130413/src/wput.c:546:10: [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 (file, "r"); data/wput-0.6.2+git20130413/src/wput.c:693:38: [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). opt.retry_interval = atoi(optarg); break; data/wput-0.6.2+git20130413/src/wput.c:701:32: [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). case 'a': opt.output = fopen(optarg, (c == 'o') ? "w" : "a"); data/wput-0.6.2+git20130413/src/wput.c:709:31: [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). opt.retry = atoi(optarg) + 1; data/wput-0.6.2+git20130413/src/wput.c:712:46: [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). case 'T': socket_set_default_timeout(atoi(optarg)); data/wput-0.6.2+git20130413/src/wput.c:727:31: [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). case 'w': opt.wait =atoi(optarg); break; data/wput-0.6.2+git20130413/src/wput.c:739:33: [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). opt.input = fopen(optarg, "r"); data/wput-0.6.2+git20130413/src/ftp-ls.c:68:7: [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 (s) < 9) data/wput-0.6.2+git20130413/src/ftp-ls.c:88: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). int len = strlen (line); data/wput-0.6.2+git20130413/src/ftp-ls.c:303: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). fnlen = strlen (tok); data/wput-0.6.2+git20130413/src/ftp-ls.c:342: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). fnlen = strlen (tok); /* re-calculate `fnlen' */ data/wput-0.6.2+git20130413/src/ftp-ls.c:677: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). len = strlen( tok); data/wput-0.6.2+git20130413/src/ftp-ls.c:774: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( tok) < 12) && (strchr( tok, '-') != NULL)) data/wput-0.6.2+git20130413/src/ftp-ls.c:779:8: [1] (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 character. strcat( date_str, " "); data/wput-0.6.2+git20130413/src/ftp-ls.c:781:14: [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). else if ((strlen( tok) < 12) && (strchr( tok, ':') != NULL)) data/wput-0.6.2+git20130413/src/ftp-ls.c:785:8: [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( date_str, data/wput-0.6.2+git20130413/src/ftp-ls.c:787:29: [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). (sizeof( date_str)- strlen( date_str)- 1)); data/wput-0.6.2+git20130413/src/ftp-ls.c:800: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). for (i = 0; i < strlen( tok); i++) data/wput-0.6.2+git20130413/src/ftp-ls.c:949:6: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = fgetc(fp); data/wput-0.6.2+git20130413/src/ftp-ls.c:999: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). upwd = (char *)xmalloc (strlen (tmpu) data/wput-0.6.2+git20130413/src/ftp-ls.c:1000: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). + (tmpp ? (1 + strlen (tmpp)) : 0) + 2); data/wput-0.6.2+git20130413/src/ftp.c:226:4: [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). strlen(opt.input_pipe) data/wput-0.6.2+git20130413/src/ftp.c:227: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). + strlen(fsession->user) data/wput-0.6.2+git20130413/src/ftp.c:228:33: [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). + (fsession->host->ip ? 15 : strlen(fsession->host->hostname)) + 5 /*port*/ data/wput-0.6.2+git20130413/src/ftp.c:229:32: [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). + (fsession->target_dname ? strlen(fsession->target_dname) : 0) data/wput-0.6.2+git20130413/src/ftp.c:230: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). + strlen(fsession->target_fname) data/wput-0.6.2+git20130413/src/ftp.c:347:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while( (readbytes = read(fd, (char *)databuf, DBUFSIZE)) != 0 ) { data/wput-0.6.2+git20130413/src/ftp.c:362:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(1000 * 200); /* sleep 0.2 seconds */ data/wput-0.6.2+git20130413/src/ftp.c:500:29: [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 * newpath = malloc(strlen(fsession->ftp->current_directory) + 1 + strlen(filename) + 1); data/wput-0.6.2+git20130413/src/ftp.c:500:76: [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 * newpath = malloc(strlen(fsession->ftp->current_directory) + 1 + strlen(filename) + 1); data/wput-0.6.2+git20130413/src/ftp.c:503:5: [1] (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 character. strcat(newpath, "/"); data/wput-0.6.2+git20130413/src/ftp.c:833:3: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep( (opt.random_wait ? 2 * (float) rand() / 0x7fffffff : 1) data/wput-0.6.2+git20130413/src/ftplib.c:99: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(msg) < 4 || !ISDIGIT(msg[0]) || !ISDIGIT(msg[1]) || !ISDIGIT(msg[2])) { data/wput-0.6.2+git20130413/src/ftplib.c:105:76: [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). printout(vLESS, _("Receive-Error: Invalid FTP-answer (%d bytes): %s\n"), strlen(msg), msg); data/wput-0.6.2+git20130413/src/ftplib.c:152:39: [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). socket_write(self->sock, self->sbuf, strlen(self->sbuf)); data/wput-0.6.2+git20130413/src/ftplib.c:157: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(cmd) data/wput-0.6.2+git20130413/src/ftplib.c:158: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). + ((value) ? strlen(value) + 1 : 0) /* value + space */ data/wput-0.6.2+git20130413/src/ftplib.c:172: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). int pos = strlen(cmd); data/wput-0.6.2+git20130413/src/ftplib.c:176:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(self->sbuf+strlen(self->sbuf), "\r\n\0", 3); data/wput-0.6.2+git20130413/src/ftplib.c:176: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). strncpy(self->sbuf+strlen(self->sbuf), "\r\n\0", 3); data/wput-0.6.2+git20130413/src/ftplib.c:629:23: [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 *value = malloc(strlen(mode) data/wput-0.6.2+git20130413/src/ftplib.c:631: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). + strlen(rfile) data/wput-0.6.2+git20130413/src/ftplib.c:634:2: [1] (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 character. strcat(value, " "); data/wput-0.6.2+git20130413/src/getopt/getopt.c:245: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 (!defined __STDC__ || !__STDC__) && !defined strlen data/wput-0.6.2+git20130413/src/getopt/getopt.c:248: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/wput-0.6.2+git20130413/src/getopt/getopt.c:439: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). int len = nonoption_flags_max_len = strlen (orig_str); data/wput-0.6.2+git20130413/src/getopt/getopt.c:667: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/wput-0.6.2+git20130413/src/getopt/getopt.c:712: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/wput-0.6.2+git20130413/src/getopt/getopt.c:778: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/wput-0.6.2+git20130413/src/getopt/getopt.c:812: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/wput-0.6.2+git20130413/src/getopt/getopt.c:817: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/wput-0.6.2+git20130413/src/getopt/getopt.c:1004: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/wput-0.6.2+git20130413/src/getopt/getopt.c:1044: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/wput-0.6.2+git20130413/src/getopt/getopt.c:1082: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/wput-0.6.2+git20130413/src/getopt/getopt.c:1114: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/wput-0.6.2+git20130413/src/getopt/getopt.c:1118: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/wput-0.6.2+git20130413/src/memdbg.c:106:33: [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 * t = (char *) dbg_malloc(strlen(s)+1, file, line); data/wput-0.6.2+git20130413/src/msvcpp/strptime.c:230:10: [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(En_US.am_string); data/wput-0.6.2+git20130413/src/msvcpp/strptime.c:240:10: [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(En_US.pm_string); data/wput-0.6.2+git20130413/src/msvcpp/strptime.c:255:11: [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(En_US.weekday_names[i]); data/wput-0.6.2+git20130413/src/msvcpp/strptime.c:261:11: [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(En_US.abbrev_weekday_names[i]); data/wput-0.6.2+git20130413/src/msvcpp/strptime.c:297:11: [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(En_US.month_names[i]); data/wput-0.6.2+git20130413/src/msvcpp/strptime.c:303:11: [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(En_US.abbrev_month_names[i]); data/wput-0.6.2+git20130413/src/progress.c:429: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). 17-strlen(transf), data/wput-0.6.2+git20130413/src/progress.c:435: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). transf, 17-strlen(transf), data/wput-0.6.2+git20130413/src/queue.c:135: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). if (*(filename + strlen(filename) - 1) == '/') data/wput-0.6.2+git20130413/src/queue.c:136: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). *(filename + strlen(filename) - 1) = '\0'; data/wput-0.6.2+git20130413/src/queue.c:156: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). if (*(K->url + strlen(K->url) - 1) == '/') data/wput-0.6.2+git20130413/src/queue.c:157: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). *(K->url + strlen(K->url) - 1) = '\0'; data/wput-0.6.2+git20130413/src/queue.c:162:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(tmpurl, K->url, len); data/wput-0.6.2+git20130413/src/queue.c:168:25: [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). } else if (*(K->url + strlen(K->url) - 1) != '/') { data/wput-0.6.2+git20130413/src/queue.c:169:29: [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). K->url = realloc(K->url, strlen(K->url) + 2); data/wput-0.6.2+git20130413/src/queue.c:170:4: [1] (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 character. strcat(K->url, "/"); data/wput-0.6.2+git20130413/src/queue.c:245: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). int pathlen = strlen(dname)+3; //so we don't need to recalculate everytime (+3== '\\*\0'); data/wput-0.6.2+git20130413/src/queue.c:260:27: [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). tmpbuf = (char *) malloc(strlen(dname)+2); //take space for this strange slash that we need to append st. data/wput-0.6.2+git20130413/src/queue.c:268: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). if(fsession->local_fname) dname += strlen(fsession->local_fname); data/wput-0.6.2+git20130413/src/queue.c:283: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). if(tmpbuf[strlen(tmpbuf)-1] != dirsep) data/wput-0.6.2+git20130413/src/queue.c:284:3: [1] (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 character. strcat(tmpbuf, "/"); data/wput-0.6.2+git20130413/src/queue.c:304:28: [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). fname = (char *) malloc(strlen(tmpbuf) + strlen(cFileName)); data/wput-0.6.2+git20130413/src/queue.c:304:45: [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). fname = (char *) malloc(strlen(tmpbuf) + strlen(cFileName)); data/wput-0.6.2+git20130413/src/queue.c:308:28: [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). fname = (char *) malloc(strlen(tmpbuf) + strlen(cFileName)+1); data/wput-0.6.2+git20130413/src/queue.c:308:45: [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). fname = (char *) malloc(strlen(tmpbuf) + strlen(cFileName)+1); data/wput-0.6.2+git20130413/src/queue.c:310: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). strcpy(fname + strlen(tmpbuf), cFileName); data/wput-0.6.2+git20130413/src/queue.c:470: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). (fsession->target_dname ? strlen(fsession->target_dname) : 0) + 1 + data/wput-0.6.2+git20130413/src/queue.c:471: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). (fsession->target_fname ? strlen(fsession->target_fname) : 0) + 1); data/wput-0.6.2+git20130413/src/queue.c:476:5: [1] (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 character. strcat(file, "/"); data/wput-0.6.2+git20130413/src/queue.c:516: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). url[strlen(url)-strlen(file)] = 0; data/wput-0.6.2+git20130413/src/queue.c:516: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). url[strlen(url)-strlen(file)] = 0; data/wput-0.6.2+git20130413/src/queue.c:525:11: [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( file[strlen(file)-1] == dirsep ) data/wput-0.6.2+git20130413/src/queue.c:526: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). file[strlen(file)-1] = 0; data/wput-0.6.2+git20130413/src/queue.c:576: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). strlen(fsession->target_dname) + 1 + data/wput-0.6.2+git20130413/src/queue.c:578:4: [1] (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 character. strcat(fsession->target_dname, "/"); data/wput-0.6.2+git20130413/src/queue.c:589:3: [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(fsession->target_dname, file, slashlen); data/wput-0.6.2+git20130413/src/queue.c:608: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). int len = ((ptr != 0x0) ? ptr-tmp : strlen(fsession->target_dname)); data/wput-0.6.2+git20130413/src/queue.c:611:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(skipdname, fsession->target_dname, len); data/wput-0.6.2+git20130413/src/queue.c:665:61: [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). (K->dir == NULL || (dir && !strncmp(K->dir, dir, strlen(K->dir))) ) ) data/wput-0.6.2+git20130413/src/socketlib.c:438: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). send(sock->fd, t, strlen(t)+1, 0); data/wput-0.6.2+git20130413/src/socketlib.c:453:27: [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 * p = malloc(strlen(ps->user) + strlen(ps->pass) + 3); data/wput-0.6.2+git20130413/src/socketlib.c:453: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). char * p = malloc(strlen(ps->user) + strlen(ps->pass) + 3); data/wput-0.6.2+git20130413/src/socketlib.c:455: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). p[1] = strlen(ps->user); data/wput-0.6.2+git20130413/src/socketlib.c:457: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). p[2+p[1]] = strlen(ps->pass); data/wput-0.6.2+git20130413/src/socketlib.c:458:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(p+3+p[1], ps->pass, p[2+p[1]]); data/wput-0.6.2+git20130413/src/socketlib.c:534: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). t = malloc(6 + strlen(hostname) + 1); data/wput-0.6.2+git20130413/src/socketlib.c:538:11: [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). t[4] = strlen(hostname); data/wput-0.6.2+git20130413/src/socketlib.c:541: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). memcpy(t+strlen(hostname)+5, (char *) &res, 2); data/wput-0.6.2+git20130413/src/socketlib.c:542: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). send(sock->fd, t, strlen(hostname)+7, 0); data/wput-0.6.2+git20130413/src/socketlib.c:580:23: [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(ps->user) + strlen(ps->pass) + 3; data/wput-0.6.2+git20130413/src/socketlib.c:580: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). int len = strlen(ps->user) + strlen(ps->pass) + 3; data/wput-0.6.2+git20130413/src/socketlib.c:583: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). strcpy(userunencoded+strlen(ps->user)+1, ps->pass); data/wput-0.6.2+git20130413/src/socketlib.c:589:27: [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). + (hostname ? strlen(hostname) : 15 /* '255.255.255.255' */) data/wput-0.6.2+git20130413/src/socketlib.c:590: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). + (userencoded ? strlen(userencoded) + 29 : 0) /* '\r\nProxy-Authorization: Basic ' */ data/wput-0.6.2+git20130413/src/socketlib.c:597:9: [1] (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 character. strcat(request, ":"); data/wput-0.6.2+git20130413/src/socketlib.c:611:27: [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). send(sock->fd, request, strlen(request), 0); data/wput-0.6.2+git20130413/src/utils.c:35: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). int dotpos = strlen(filename); data/wput-0.6.2+git20130413/src/utils.c:41:7: [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). k = strlen(suffix); data/wput-0.6.2+git20130413/src/utils.c:197: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). length += strlen (line + length); data/wput-0.6.2+git20130413/src/utils.c:345: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). mod = strlen (inptr) % 3; data/wput-0.6.2+git20130413/src/utils.c:389:32: [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 * t = (char *) malloc(strlen(s)+1); data/wput-0.6.2+git20130413/src/utils.c:397: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). char * t = p + strlen(p); data/wput-0.6.2+git20130413/src/utils.c:404: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). if(!strncmp(opt.basename, file, strlen(opt.basename))) data/wput-0.6.2+git20130413/src/utils.c:405: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). return file+strlen(opt.basename); data/wput-0.6.2+git20130413/src/utils.c:406:81: [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). else if(file[0] == '.' && file[1] == dirsep && !strncmp(opt.basename, file+2, strlen(opt.basename))) data/wput-0.6.2+git20130413/src/utils.c:407: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). return file+2+strlen(opt.basename); data/wput-0.6.2+git20130413/src/utils.c:466:29: [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). tmp = malloc(counter * 3 + strlen(mark_dst) + 1); data/wput-0.6.2+git20130413/src/utils.c:472: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(tmp[strlen(tmp)-1] == '/') tmp[strlen(tmp)-1] = 0; data/wput-0.6.2+git20130413/src/utils.c:472: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(tmp[strlen(tmp)-1] == '/') tmp[strlen(tmp)-1] = 0; data/wput-0.6.2+git20130413/src/wget.h:7:9: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define fgetc( x) nextchr() data/wput-0.6.2+git20130413/src/windows.h:32:9: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. #define usleep(X) Sleep((X) / 1000) data/wput-0.6.2+git20130413/src/wput.c:134: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). if(!strncmp(&argv[0][strlen(argv[0])-4], "wdel", 5)) data/wput-0.6.2+git20130413/src/wput.c:285:10: [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(url[strlen(url)-2] == '\r') data/wput-0.6.2+git20130413/src/wput.c:286: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). url[strlen(url)-2] = 0; data/wput-0.6.2+git20130413/src/wput.c:287:7: [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[strlen(url)-1] = 0; data/wput-0.6.2+git20130413/src/wput.c:462:28: [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 = (char *) malloc(strlen (home) + 1 + data/wput-0.6.2+git20130413/src/wput.c:463:7: [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). strlen (NETRC_FILE_NAME) + 1); data/wput-0.6.2+git20130413/src/wput.c:517:11: [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(pass[strlen(pass)-2] == '\r') pass[strlen(pass)-2] = 0; data/wput-0.6.2+git20130413/src/wput.c:517: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). if(pass[strlen(pass)-2] == '\r') pass[strlen(pass)-2] = 0; data/wput-0.6.2+git20130413/src/wput.c:518: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). else if(pass[strlen(pass)-1] == '\n') pass[strlen(pass)-1] = 0; data/wput-0.6.2+git20130413/src/wput.c:518: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). else if(pass[strlen(pass)-1] == '\n') pass[strlen(pass)-1] = 0; data/wput-0.6.2+git20130413/src/wput.c:533:23: [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). file = malloc(strlen(home) + 10); /* home + slash + (.wputrc | wput.ini) + 0-char */ data/wput-0.6.2+git20130413/src/wput.c:841:28: [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). memset(argv[optind], ' ', strlen(argv[optind])); ANALYSIS SUMMARY: Hits = 286 Lines analyzed = 9673 in approximately 0.30 seconds (32557 lines/second) Physical Source Lines of Code (SLOC) = 6879 Hits@level = [0] 104 [1] 133 [2] 91 [3] 22 [4] 37 [5] 3 Hits@level+ = [0+] 390 [1+] 286 [2+] 153 [3+] 62 [4+] 40 [5+] 3 Hits/KSLOC@level+ = [0+] 56.6943 [1+] 41.5758 [2+] 22.2416 [3+] 9.01294 [4+] 5.8148 [5+] 0.43611 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.