summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2013-07-03 15:09:08 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 16:08:06 -0700
commit8da01af45e197110cbce84fb5ccb54645f051ac6 (patch)
tree843d63f52ed7fe1a6e1bcb70cff6841c43a87382
parent94ac11833fc46fcde6eec7d97893a44c7673967b (diff)
Documentation/accounting/getdelays.c: avoid strncpy in accounting tool
Avoid strncpy anti-pattern. [akpm@linux-foundation.org: remove the str[cpy|dup] altogether] Signed-off-by: Kees Cook <keescook@chromium.org> Cc: Andreas Schwab <schwab@linux-m68k.org> Cc: Rob Landley <rob@landley.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--Documentation/accounting/getdelays.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Documentation/accounting/getdelays.c b/Documentation/accounting/getdelays.c
index f8ebcde43b17..c6a06b71594d 100644
--- a/Documentation/accounting/getdelays.c
+++ b/Documentation/accounting/getdelays.c
@@ -272,7 +272,7 @@ int main(int argc, char *argv[])
char *logfile = NULL;
int loop = 0;
int containerset = 0;
- char containerpath[1024];
+ char *containerpath = NULL;
int cfd = 0;
int forking = 0;
sigset_t sigset;
@@ -299,7 +299,7 @@ int main(int argc, char *argv[])
break;
case 'C':
containerset = 1;
- strncpy(containerpath, optarg, strlen(optarg) + 1);
+ containerpath = optarg;
break;
case 'w':
logfile = strdup(optarg);