chiark / gitweb /
bootchart: properly terminate string
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 29 Mar 2013 03:41:07 +0000 (23:41 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 29 Mar 2013 03:45:52 +0000 (23:45 -0400)
commitc309a7137b06516eafc055eaab31df964599a8b3
tree56d7aef3313ca4894418e4ee257f09c44a777206
parent268888765352e4dcf07e40917fef6ab41b7deba1
bootchart: properly terminate string

systemd-199/src/bootchart/store.c:289: buffer_size_warning: Calling
strncpy with a maximum size argument of 256 bytes on destination array
"ps->name" of size 256 bytes might leave the destination string
unterminated.

...and indeed, the string was used as NULL-terminated later on.

pid_cmdline_strncpy is renamed to pid_cmdline_strscpy to commemorate
the fact that it *does* properly terminate the string.
src/bootchart/store.c