projects
/
platform
/
upstream
/
coreutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4c13a6d
)
maint: replace a use of strcpy in chmod.c with memcpy
author
Jim Meyering
<meyering@redhat.com>
Mon, 16 Apr 2012 13:12:02 +0000
(15:12 +0200)
committer
Jim Meyering
<meyering@redhat.com>
Mon, 16 Apr 2012 13:12:02 +0000
(15:12 +0200)
* src/chmod.c (main): Use memcpy rather than strcpy,
since we already have the length handy.
src/chmod.c
patch
|
blob
|
history
diff --git
a/src/chmod.c
b/src/chmod.c
index
aa4ac77
..
a54078c
100644
(file)
--- 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;