diff options
-rw-r--r-- | lib/libfetch/ftp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c index 1274019..25ea020 100644 --- a/lib/libfetch/ftp.c +++ b/lib/libfetch/ftp.c @@ -746,6 +746,8 @@ _ftp_authenticate(int cd, struct url *url, struct url *purl) logname = FTP_ANONYMOUS_USER; if ((len = snprintf(pbuf, MAXLOGNAME + 1, "%s@", logname)) == -1) len = 0; + else if (len > MAXLOGNAME) + len = MAXLOGNAME; gethostname(pbuf + len, sizeof pbuf - len); pwd = pbuf; } |