diff options
author | Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> | 2014-06-23 22:22:04 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-24 01:47:44 +0200 |
commit | 88e15ce402c58f41037752da092683e90826742a (patch) | |
tree | 1e20d014a7e31b2ffe1347384533ef928e61429a /Documentation | |
parent | drivers/memstick/host/rtsx_pci_ms.c: add cancel_work when remove driver (diff) | |
download | linux-88e15ce402c58f41037752da092683e90826742a.tar.xz 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')
-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; |