From: rousskov <> Date: Sun, 22 Mar 1998 14:38:59 +0000 (+0000) Subject: - Fixed a bug when we were printing a non-existent "->" link as a part of the X-Git-Tag: SQUID_3_0_PRE1~3769 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b63416be23aef4a07541da78cfb70eb6918a7c7;p=thirdparty%2Fsquid.git - Fixed a bug when we were printing a non-existent "->" link as a part of the ftp dir entry. For example, the following should not lead to a coredump now: l------rw- 747 0 747 Jan 8 19:31 .message --- diff --git a/src/ftp.cc b/src/ftp.cc index b7d6047203..8ba04b3410 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -1,6 +1,6 @@ /* - * $Id: ftp.cc,v 1.209 1998/03/20 18:06:43 rousskov Exp $ + * $Id: ftp.cc,v 1.210 1998/03/22 07:38:59 rousskov Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -643,9 +643,11 @@ ftpHtmlifyListEntry(char *line, FtpStateData * ftpState) rfc1738_escape(parts->name), parts->showname, dots_fill(strlen(parts->showname))); - snprintf(link2, 2048, "%s", - rfc1738_escape(parts->link), - parts->link); + /* sometimes there is an 'l' flag, but no "->" link */ + if (parts->link) + snprintf(link2, 2048, "%s", + rfc1738_escape(parts->link), + parts->link); snprintf(html, 8192, "%s %s [%s] -> %s\n", icon, link,