From: Jim Meyering Date: Mon, 16 Apr 2012 13:12:02 +0000 (+0200) Subject: maint: replace a use of strcpy in chmod.c with memcpy X-Git-Tag: v8.17~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31f19d681f91347f0f4b9d4ed148b6aed996bf7e;p=thirdparty%2Fcoreutils.git maint: replace a use of strcpy in chmod.c with memcpy * src/chmod.c (main): Use memcpy rather than strcpy, since we already have the length handy. --- diff --git a/src/chmod.c b/src/chmod.c index aa4ac771c7..a54078c012 100644 --- a/src/chmod.c +++ b/src/chmod.c @@ -472,7 +472,7 @@ main (int argc, char **argv) mode = X2REALLOC (mode, &mode_alloc); } mode[mode_len] = ','; - strcpy (mode + mode_comma_len, arg); + memcpy (mode + mode_comma_len, arg, arg_len + 1); mode_len = new_mode_len; diagnose_surprises = true;