diff options
author | Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> | 2014-06-23 13:22:04 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-23 16:47:44 -0700 |
commit | 88e15ce402c58f41037752da092683e90826742a (patch) | |
tree | 1e20d014a7e31b2ffe1347384533ef928e61429a /Documentation/accounting | |
parent | b6226b45c66196e14ef628d3aead2139700db1ad (diff) | |
download | linux-88e15ce402c58f41037752da092683e90826742a.tar.gz linux-88e15ce402c58f41037752da092683e90826742a.tar.bz2 linux-88e15ce402c58f41037752da092683e90826742a.zip |
Documentation/accounting/getdelays.c: add missing null-terminate after strncpy call
Added a guaranteed null-terminate after call to strncpy.
This was partly found using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/accounting')
-rw-r--r-- | Documentation/accounting/getdelays.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Documentation/accounting/getdelays.c b/Documentation/accounting/getdelays.c index c6a06b71594d..f40578026a04 100644 --- a/Documentation/accounting/getdelays.c +++ b/Documentation/accounting/getdelays.c @@ -314,6 +314,7 @@ int main(int argc, char *argv[]) break; case 'm': strncpy(cpumask, optarg, sizeof(cpumask)); + cpumask[sizeof(cpumask) - 1] = '\0'; maskset = 1; printf("cpumask %s maskset %d\n", cpumask, maskset); break; |