Changed strcpy() calls into strlcpy() calls, just to be extra safe.
[rsync/rsync.git] / tls.c
diff --git a/tls.c b/tls.c
index 2f5b6b4..719c8c5 100644 (file)
--- a/tls.c
+++ b/tls.c
@@ -13,9 +13,9 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
 /* The problem with using the system's own ls is that some features
@@ -74,7 +74,7 @@ static void list_file(const char *fname)
                buf.st_mode &= ~0777;
                buf.st_mtime = (time_t)0;
                buf.st_uid = buf.st_gid = 0;
-               strcpy(linkbuf, " -> ");
+               strlcpy(linkbuf, " -> ", sizeof linkbuf);
                /* const-cast required for silly UNICOS headers */
                len = readlink((char *) fname, linkbuf+4, sizeof(linkbuf) - 4);
                if (len == -1)
@@ -99,7 +99,7 @@ static void list_file(const char *fname)
                        (int)mt->tm_min,
                        (int)mt->tm_sec);
        } else {
-               strcpy(datebuf, "                   ");
+               strlcpy(datebuf, "                   ", sizeof datebuf);
        }
 
        /* TODO: Perhaps escape special characters in fname? */