Changed strcpy() calls into strlcpy() calls, just to be extra safe.
[rsync.git] / options.c
index 05df91e4662a1258d6584ed9e4487a6377f3f145..47fdaa3db8260ddab6c120d759be514052b6e540 100644 (file)
--- a/options.c
+++ b/options.c
@@ -613,8 +613,9 @@ static char err_buf[200];
 void option_error(void)
 {
        if (!err_buf[0]) {
-               strcpy(err_buf, "Error parsing options: "
-                   "option may be supported on client but not on server?\n");
+               strlcpy(err_buf, "Error parsing options: option may "
+                       "be supported on client but not on server?\n",
+                       sizeof err_buf);
        }
 
        rprintf(FERROR, RSYNC_NAME ": %s", err_buf);
@@ -832,7 +833,9 @@ int parse_arguments(int *argc, const char ***argv, int frommain)
 
                case OPT_DAEMON:
                        if (am_daemon) {
-                               strcpy(err_buf, "Attempt to hack rsync thwarted!\n");
+                               strlcpy(err_buf,
+                                       "Attempt to hack rsync thwarted!\n",
+                                       sizeof err_buf);
                                return 0;
                        }
                        poptFreeContext(pc);