diff options
author | Kees Cook <keescook@chromium.org> | 2013-07-03 18:09:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-03 19:08:06 -0400 |
commit | 8da01af45e197110cbce84fb5ccb54645f051ac6 (patch) | |
tree | 843d63f52ed7fe1a6e1bcb70cff6841c43a87382 | |
parent | 94ac11833fc46fcde6eec7d97893a44c7673967b (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.c | 4 |
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[]) | |||
272 | char *logfile = NULL; | 272 | char *logfile = NULL; |
273 | int loop = 0; | 273 | int loop = 0; |
274 | int containerset = 0; | 274 | int containerset = 0; |
275 | char containerpath[1024]; | 275 | char *containerpath = NULL; |
276 | int cfd = 0; | 276 | int cfd = 0; |
277 | int forking = 0; | 277 | int forking = 0; |
278 | sigset_t sigset; | 278 | sigset_t sigset; |
@@ -299,7 +299,7 @@ int main(int argc, char *argv[]) | |||
299 | break; | 299 | break; |
300 | case 'C': | 300 | case 'C': |
301 | containerset = 1; | 301 | containerset = 1; |
302 | strncpy(containerpath, optarg, strlen(optarg) + 1); | 302 | containerpath = optarg; |
303 | break; | 303 | break; |
304 | case 'w': | 304 | case 'w': |
305 | logfile = strdup(optarg); | 305 | logfile = strdup(optarg); |